cf_make_sem¶
Category: multithreading
GitHub: cute_multithreading.h
Returns an initialized semaphore.
Parameters | Description |
---|---|
initial_count | The initial value of the semaphore. |
Remarks¶
Semaphores are used to prevent race conditions between multiple threads that need to access common resources. Usually you'll have N resources, and initialize the semaphore to N. This is a rather advanced and low-level topic, beware. To learn more about semaphores I suggest reading the online book "The Little Book of Semaphores".
Related Pages¶
CF_Semaphore
cf_sem_value
cf_destroy_sem
cf_sem_post
cf_sem_try
cf_sem_wait