[racket] Can places blocked on mzrt semaphores be killed with place-kill?

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Nov 11 11:13:28 EST 2011

At Thu, 3 Nov 2011 14:52:52 -0700, John Clements wrote:
> If I have a place that's blocked on an mzrt-semaphore
> (not a regular one, but a full-on-block-an-OS-thread semaphore), will
> (place-kill ...) successfully kill the place?

[Sorry for the long delay!]

No --- `place-kill' is cooperative at that level.

To allow a place to be killed, you have to use scheme_block_until(), in
general. Unfortunaetly, scheme_block_until() doesn't interact nicely
with semaphores, except on Windows. An alternative for non-Windows
platforms is to use an OS pipe instead of a semaphore, since
file-descriptor waiting can cooperate with scheme_block_until().

Posted on the users mailing list.