[PEAK] trellis activity does not save/restore Contextual context between task switches

P.J. Eby pje at telecommunity.com
Sat Mar 21 18:04:20 EDT 2009


At 05:35 PM 3/21/2009 -0400, Andrew Svetlov wrote:
>As I fugured out trellis activity tasks does not switching context
>inside task working loop. It leads to situation what if my tasks uses
>something like context.new() in own code I cannot run two of them
>together.
>
>I made patch for TaskCell._stepper to support this feature. Main
>change is: STACK now contains not only current generators for tasks
>but also last context.State for every generator and updates states
>when need.

Is that really necessary?  It seems to me that you should only need 
one saved state for the entire task, and simply swap it in and out 
around the send/throw/next call.


>Please review and if this patch is clean - put it into current trellis trunk.
>If not - please point where I'm wrong.

It doesn't appear that you've actually provided a patch, and it does 
something involving some "fds_main.utilities.trellis" module in any 
event.  Tests should be either a doctest or a patch to the test_trellis module.



More information about the PEAK mailing list