I just realized that there are various interesting ways to crash stackless with 
threads.
This one is simple
Import treading, stackless
Def foo():
  Global task
  Task = stackless.getcurrent()
Threading.Thread(target=foo).start()
...
Task.thread_id

This will crash because the other thread's task->cstate is NULL.

This is fixable.  But what about other cases?  Tasklets that are blocked (or 
removed) when their thread exits?
Their task->cstate->tstate will be invalid.  And so, there are a number of 
things that can be done to crash them, like task.insert(), I imagine.
Should we worry about this?  Or should we simply require of the programmer that 
for safe operation, a thread should exist at least as long as all tasklets 
created on it, and leave it to the programmer to ensure?

K
_______________________________________________
Stackless mailing list
[email protected]
http://www.stackless.com/mailman/listinfo/stackless

Reply via email to