Skip to content

vrachnis/rw_locks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a very simple implementation of the reader/writer lock
implementation written in C using mutexes and condition variables.

The purpose of this was to learn about the mechanics behind thread synchronization.

If you want to use this you have to follow these steps:

-declare a rw_lock_t pointer (struct rw_lock_t *rwvar=NULL)
-initialize the pointer (rw_init(rwvar))
-call rw_readlockr/rw_readunlock/rw_writelock/rw_writeunlock when needed (rw_writelock(rwvar))
-when finished, call rw_destroy to free the allocated memory (rw_destroy(rwvar))

See the file LICENSE for licencing information.

About

a simple implementation of read/write lock operations

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages