Search Google with: "Linux semaphores" and have a look through the websites on the subject.
As the use of semaphores in the past has caused more problems than created solutions therefore semaphores are not use in the producer and consumer problem.
send signals
The use of semaphores
a semaphore is a stoplight and or traffic signal.
strong semaphores specify the order in which processes are removed from the queue, which guarantees avoiding starvation. Weak semaphores do not specify the order in which processes are removed from the queue.
They were called Semaphores.
the differents is the bathroom time
Three types of semaphores: 1.General/Counting semaphores: (can take any non-negative value) These are used when you might have multiple devices (like 3 printers or multiple memory buffers). 2.Binary semaphores: (can either be 0 or 1) These are used to gain exclusive access to a single resource (like the serial port, a non-reentrant library routine, or a hard disk drive). A counting semaphore that has a maximum value of 1 is equivalent to a binary semaphore (because the semaphore's value can only be 0 or 1). 3.Mutex semaphores: These are optimized for use in controlling mutually exclusive access to a resource. There are several implementations of this type of semaphore.
There are a number of ways the word semaphores might be used in a sentence. The definition of this word is that it is a system of sending messages using a series of flags in certain positions, signifying different messages with several meanings.
Semaphores are a useful tool for mutual exclusion, but they are not the only such tool provided by the kernel. Instead, most locking is implemented with a mechanism called a spinlock. Unlike semaphores, spinlocks may be used in code that cannot sleep, such as interrupt handlers. When properly used, spinlocks offer higher performance than semaphores in general. They do, however, bring a different set of constraints on their use.
n programming, especially in Unix systems, semaphores are a technique for coordinating or synchronizing activities in which multiple processes compete for the same operating system resources. A semaphore is a value in a designated place in operating system (or kernel) storage that each process can check and then change. Depending on the value that is found, the process can use the resource or will find that it is already in use and must wait for some period before trying again. Semaphores can be binary (0 or 1) or can have additional values. Typically, a process using semaphores checks the value and then, if it using the resource, changes the value to reflect this so that subsequent semaphore users will know to wait.Semaphores are commonly use for two purposes: to share a common memory space and to share access to files. Semaphores are one of the techniques for inter-process communication (IPC). The C programming language provides a set of interfaces or "functions" for managing semaphores.