[Stackless] atomic

Nicolas Stein n.stein at internike.com
Sat Sep 13 20:15:00 CEST 2008


Hi all,

This will probably sound like a dumb question, but I just want you guys
to confirm me something, before having coded thousand lines of stackless
(just a few hundreds for now !) :

I'm coding a bunch of "actions" methods like the following :

def  foobar_action(self,ch):
    while(1):
      m=ch.receive()
     ## Some stuff...
     ## A few lines that must be executed without being interrupted
(being atomic)
     ## Some stuff...

There is never anything blocking in these "actions" except the starting
ch.receive().
They are triggered by a "dispatcher" that triggers the right "action" by
sending to the right channel.

Am I right in assuming that, if I never use preemptive scheduling, I
never need to use "...set_atomic(True)...",
to guarantee the atomicity of the middle block ?


thx,

Nike





More information about the Stackless mailing list