Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

implementing V() / signal()

0 views
Skip to first unread message

ChrisA

unread,
Nov 22, 2009, 1:46:40 AM11/22/09
to

Why would this function need to do anything other than increment the
semaphore? I can see why P() needs to decrement then wait -- but is
there a need for V() to context switch on sem <= 0 etc?

TIA

Ben Pfaff

unread,
Nov 22, 2009, 8:57:26 PM11/22/09
to
ChrisA <thechris...@gmail.com> writes:

Something needs to wake up a thread that is waiting in P(), if
there is one, and doing it as part of V() is the most
straightforward implementation.
--
Ben Pfaff
http://benpfaff.org

0 new messages