On 22/02/18 01:02, Robby Findler wrote: > You can create a thread and wait simultaneously on the place channel > value and also on some channel that the various workers use to check > in and see if a value is available. Here's a very simple instantiation > of this idea. >
Thanks. That looks like it could work with my current architecture. > More generally, I think that one of the underappreciated parts of > Racket's built in features are `evt`s. Do check out what they can do. > You can do much more sophisticated protocols that are tailored to > exactly what you need. > Just finished reading the reference manual on evt's. A feature I had not used before. Looks great. While doing so I noticed two things: 1. There's no guide chapter on evts with guide-like explanations and examples; although the ref is not bad either; 2. It doesn't say place channels were evts. Actually when I looked at your example I thought you missed the fact I was talking about place channels and not normal channels. Also because the reference mentions: "Racket values that act as synchronizable events include semaphores, channels, asynchronous channels, ports, TCP listeners, log receivers, threads, subprocesses, will executors, and custodian boxes. Libraries can define new synchronizable events, especially though prop:evt." There's no mention of place channels. I was happy to find out that your example would work with place channels as well because: > (define-values (p1 p2) (place-channel)) > (evt? p1) #t Thanks, -- Paulo Matos -- 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 racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.