The docs for semaphores say this:

In general, it is impossible using only semaphore-wait to implement the 
> guarantee that either the semaphore is decremented or an exception is 
> raised, but not both. Racket therefore supplies semaphore-wait/enable-break 
> (see Semaphores), which does permit the implementation of such an exclusive 
> guarantee.

I understand the purpose of semaphore-wait/enable-break, but there's 
something about semaphore-wait that confuses me: why does it allow breaking 
at all? My understanding is that if breaks are enabled, semaphore-wait 
still tries to block and decrement the counter, even though a break at any 
time could destroy the integrity of the semaphore. Does that mean it's not 
kill-safe to use a semaphore as a lock? Wouldn't it be safer if 
semaphore-wait automatically disabled breaks while waiting?

You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To view this discussion on the web visit

Reply via email to