[parisc-linux] semaphore problem

Matthew Wilcox matthew@wil.cx
Fri, 16 Mar 2001 06:25:49 +0000


as i suspected, the pipe problem was a semaphore problem.  here's how
it works:

P1: down() count = 0
P2: down() -> __down() -> schedule() count = -1
P1: up() -> wake_up() [P1 placed on runqueue] count = 0
P1: down() -> __down() -> schedule() count = -1

now P2 gets scheduled, sees count is -1, assumes it missed the wakeup
and goes back to sleep.  both tasks are now sleeping on the same semaphore.

i'm going to bed now.  'night!

-- 
Revolutions do not require corporate support.