In a Real-Time Operating System (RTOS), what is the primary purpose of a semaphore?
-
A
To allocate contiguous heap blocks
-
B
To synchronize access to shared resources or signal events between tasks
-
C
To set task priority levels at compile time
-
D
To configure peripheral DMA channels