> What are the different types of Mutual exclusion primitives available > in linux? I know there is the pthread mutex and semaphores. Is there > anything else? Off of the top of my head: 1) pthreads spinlocks 2) pthreads barriers 3) pthreads conditional variables 4) pthreads rwlocks 5) SysV semaphore sets 6) SysV message queues 7) fcntl file locks 8) flock file locks 9) You could probably do something with signals as well, if you're careful 10) Or with a load of pipes and suitable ingenuity 11) link() and the dnotify API, if you're feeling somewhat silly 12) flockfile() These require varying degrees of cleverness to use, and the best one (as always) depends on what you're using it for. There are probably more if you look hard enough, as well. Unless you have somewhat unusual needs, it's probably easiest to stick to pthreads mutexs and semaphores. Steven Smith, sos22@cam.ac.uk.