Differences between semaphores and blocking in Linux
Source: Internet
Author: User
Differences between semaphores and blocking in Linux-Linux general technology-Linux programming and kernel information. The following is a detailed description. Creator
Sz111@126.com
The semaphore contains the up function, which will wake up the process waiting for the semaphore, And the wakeup will also wake up the process on the waiting queue. In fact, there is a waiting queue inside the semaphore.
The difference between the two is:
Up only wakes up one process, because once the process obtains the semaphore, other processes still have to wait.
Wakeup will wake up all processes in the waiting queue.
It is often seen that there is another wakeup after some usage is up. This is the problem. However, it is not very in-depth. Therefore, we are not sure whether the understanding is correct.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service