From 9dd3442861ac048ad23724156d04263f24ec6d68 Mon Sep 17 00:00:00 2001 From: Tobit Flatscher <53856473+2b-t@users.noreply.github.com> Date: Sat, 8 Jun 2024 01:28:01 +0100 Subject: [PATCH] docs: Correct minor typos in real-time programming documentation --- doc/RealTimeProgramming.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/RealTimeProgramming.md b/doc/RealTimeProgramming.md index bcabaa5..348b3ab 100644 --- a/doc/RealTimeProgramming.md +++ b/doc/RealTimeProgramming.md @@ -29,10 +29,10 @@ One can find a few developer checklists for real-time programming such as [this] struct ::sched_param param {}; ::pthread_getschedparam(t.native_handle(), &policy, ¶m); param.sched_priority = 80; - ::pthread_setschedparam(t.native_handle(), &policy, ¶m); + ::pthread_setschedparam(t.native_handle(), policy, ¶m); ``` -- Set a **scheduling policy** that fits your needs (see [here](https://man7.org/linux/man-pages/man7/sched.7.html)). **SCHED_FIFO`** is likely the one you want to go for if you do not have a particular reason to do otherwise: +- Set a **scheduling policy** that fits your needs (see [here](https://man7.org/linux/man-pages/man7/sched.7.html)). **`SCHED_FIFO`** is likely the one you want to go for if you do not have a particular reason to do otherwise: ```c #include #include @@ -41,7 +41,7 @@ One can find a few developer checklists for real-time programming such as [this] struct ::sched_param param {}; ::pthread_getschedparam(t.native_handle(), &policy, ¶m); policy = SCHED_FIFO; - ::pthread_setschedparam(t.native_handle(), &policy, ¶m); + ::pthread_setschedparam(t.native_handle(), policy, ¶m); ``` - Dynamic memory allocation (reserving virtual and physical memory) is slow and so is copying. Both are generally not real-time safe. **Avoid any form of dynamic memory allocation inside real-time code**: