Skip to content

C Library for creating Lockers (MutEx, Semaphore, rwlock)

Notifications You must be signed in to change notification settings

Alex-1611/Lockers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lockers

There are 2 libraries implementing 2 types of MutEx es and Semaphores, both for linux.


lockers.h Mutual exlusion provided by the usage of a queue.

MutEx: Prevents starvation by using a queue of waiting threads. Uses sleep and signals to reduce overhead.

Semaphore: Has fixed number of resources. Prevents starvation by using a queue of waiting threads. Uses sleep and signals to reduce overhead.


lockers2.h Similar to pthread mutex and semaphore. Mutual exclusion provided by using atomic CAS.

MutEx: Uses atomic CAS. No starvation prevention (maybe the futex provides it). Uses futexes for reduced overhead.

Semaphore: Uses the defined mutex to work with the semaphore values. No starvation prevention (maybe the futex provides it). Uses futexes for reduced overhead.

About

C Library for creating Lockers (MutEx, Semaphore, rwlock)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages