> assuming a tight 1:1 coupling between sleep and
> wakeup is a recipe for trouble.  even if your change
> fixes one possible race (i didn't bother to see what changed),
> you still have to deal with

the point of sleep/rendezvous is tight coupling, no?

the change was to move the ready() to after the rendezvous
lock was dropped.  therefore the sleeper knows the rendezvous
is not locked by the event that woke him.  if one can assert
that each sleep has exactly one wakeup (as is often the case
for rpc-style programming), then that is enough to know
the rendezvous can be retired.

> these races are inherent to the definition of sleep and
> wakeup.  it doesn't mean what you need it to mean
> to free memory immediately after sleeping on it.

if not a tight coupling, what kind of coupling would you
think is appropriate?  when would you think it would be
fair to recycle the rendezvous?  10s?  :-)  what idiom do
you think would be appropriate for such a case?

- erik

Reply via email to