On Nov 23, 2009, at 12:13 PM, Andrew Francis wrote: > >> I pictured it having an interface like: >> >> while True: >> selected_channel = select(quit_channel, request_channel) >> if selected_channel is quit_channel: >> return >> elif selected_channel is request_channel: > > This is essentially how I would write it. I would provide a > list of channels and return a list of channels that are ready. For > efficiency, I would provide an additional value, hint, to prevent > the scheduler from tearing-down the structure when select returns. > > readyList = select([channels], hint = True) > > but for a start I would simply the interface to return a single channel.
Unfortunately that seems to create a race condition (opposed to the implementations in other environments where the "select-like-operation" actually pops off the message). [Unless you also propose a non-blocking receive...which would have other problems.... I haven't been following this thread completely...] Imagine the tasklet interrupted (by someone else receiving from the same channel) between the select and the following .receive(...) > ... > I understand your minimalist approach towards Stackless. However I think > Stackless can evolve only so far without actual changes to the scheduler. > Priorities involved a change to the scheduler. Again, I I do agree with this... > believe PyPy provides an opportunity to prototype changes in a safe and fast > way. > > Cheers, > Andrew > > > > > > > > > _______________________________________________ > Stackless mailing list > [email protected] > http://www.stackless.com/mailman/listinfo/stackless > _______________________________________________ Stackless mailing list [email protected] http://www.stackless.com/mailman/listinfo/stackless
