Re: Diff between Semaphore and Completion Variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I would appreciate if some one could explain the difference between
"completion" variables and the semaphores in Linux.
1) In semaphore, there is a variable, P() first test the variable and make the
process sleep when it equals 0. In condition variable, there is no variable,
instead, condition is external variable defined by process. The variable
is tested by the process itself. In another word, sleeping is explicit in
contion variable while implicit in sempaphore.

2) Whether there are waiting processes, V() alway increases the variable,
however,signal() of contition variable will do nothing when there is no waiting
process.

Hope this helpful !
Good Luck!

Regards,
Cheng
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

[Index of Archives]     [Audio]     [Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Fedora Users]

  Powered by Linux