Strictly 'local' threads in Python?

Brian Haskin haskin at
Wed Sep 6 19:17:47 CEST 2000

Take a look at microthreads. The only catch is that it requires
stackless python, which is only available as a patch to 1.5.2 (nice
thing is it may result in a speed increase in your program).
Microthreads can be found at

Brian Haskin
haskin at

Robert Yodlowski wrote:
> I need to control several concurrently running, independent sequences of
> activities from Python functions. Up to now I've been using the standard
> Python threading module with fine results.
> Now, I need to be able to do something similar but embedded in a different
> application that "does not support threading". I've tried embedding Python
> with the standard threading module but the application crashes immediately
> when I try to run it.
> The only reason I've used threads is to avoid the need to 'manually' keep
> track of where each sequence is executing as control is passed around from
> one sequence to another. I explicitly 'hop' from thread to thread so only a
> single thread is active at any given instant.
> It seems to me that this limited form of threading could be accomplished
> strictly locally within the Python interpreter without any need to include
> or use the OS's threading facility.
> Can this be done?
> Has anyone done it?
> Any advice would be appreciated.
> ...Bob

More information about the Python-list mailing list