Skip to content

Hong-Xiao-Yun/semaphore_c11

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Semaphore with C11

The C standard C11 introduces conditional variables and mutexes. But it does not introduce semaphores. From the other hand, it is not hard to implement semaphore using existing stuff. Here is an example how to implement semaphore and a simple project of semaphore usage - "ring buffer". Unfortunately GCC still does not implement all new features including mutexes and conditional variables. I had to use 3rd-party threads implementation from https://github.com/jtsiomb/c11threads. This module uses pthreads.h that is not available on Windows for some configurations. At least the semaphore and the example should complile and run without any issue on Linux and Windows + MinGW-64bit.

Releases

No releases published

Packages

No packages published

Languages

  • C 88.9%
  • Makefile 7.8%
  • C++ 3.3%