mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
examples:
There are two threads involved: thread A with a priority of 100 and
thread B with a priority of 101. Here's how they interact:
When thread A releases a semaphore, thread B is scheduled to execute
some code and may reacquire the semaphore. If no other tasks are ready,
thread A will be scheduled to run.
This continuous process can lead to a busy loop.
Thread A: Thread B:
while (nxsem_get_value(&priv->wait, &semcount) >= 0 && <---
semcount <= 0) | 2)context switch
{ 1)contex switch |
nxsem_post(&priv->wait); -------------> run some code and nxsem_wait again
}
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
|
||
|---|---|---|
| .. | ||
| addrenv.c | ||
| CMakeLists.txt | ||
| dev_ascii.c | ||
| dev_mem.c | ||
| dev_null.c | ||
| dev_zero.c | ||
| goldfish_pipe.c | ||
| Kconfig | ||
| lwl_console.c | ||
| Make.defs | ||
| mkrd.c | ||
| optee.c | ||
| optee_msg.h | ||
| ramdisk.c | ||
| rpmsgblk.c | ||
| rpmsgblk.h | ||
| rpmsgblk_server.c | ||
| rpmsgdev.c | ||
| rpmsgdev.h | ||
| rpmsgdev_server.c | ||
| rwbuffer.c | ||