- #1
Eus
- 94
- 0
Hi Ho!
I read on http://en.wikipedia.org/wiki/Semaphore_(programming) that
P(Semaphore s, integer howmany)
{
wait until s >= 0;
s := s - howmany; /* must be atomic operation */
wait until s >= 0;
}
Must the whole function of P be atomic or just the "s := s - howmany;" part?
A pointer to a more detailed resource would help also.
Thank you very much.
Eus
I read on http://en.wikipedia.org/wiki/Semaphore_(programming) that
P(Semaphore s, integer howmany)
{
wait until s >= 0;
s := s - howmany; /* must be atomic operation */
wait until s >= 0;
}
Must the whole function of P be atomic or just the "s := s - howmany;" part?
A pointer to a more detailed resource would help also.
Thank you very much.
Eus