[racket-dev] scheme_sema_post_all
On 2011-10-22 9:41 AM, Tony Garnock-Jones wrote:
> (Context: I want to build a kind of box that starts empty, is able to be
> given a value exactly once, and that threads can wait on until its value
> is set by some other thread. Currently I'm using a channel and a
> newly-spun-up thread that loops in a channel-put, but it's not kill-safe
> I don't think, and creating a thread whenever the box is filled is quite
> heavy compared to doing a scheme_sema_post_all. Incidentally, the
> behaviour I'm after is very similar to (thread-dead-evt). I'll be using
> it, among other things, to hold the fatal exception that killed a
> thread, if any.)
Nothing like the 20 seconds or so after a post to make one question
oneself. Could it be that semaphore-peek-evt could be used to get what I
need? I'll experiment.
Regards,
Tony