[CentralOH] Stackless Python

Brian Costlow brian.costlow at gmail.com
Wed Oct 28 21:46:42 CET 2009


I evaluated Stackless for a project a couple of years ago, but ended up not
using it, primarily because the alternative I was looking at (Twisted
running in cpython) already had some built-in functionality related to what
I was doing.

Unless there's been a major change though, Stackless doesn't take advantage
of multiple processors or cores in any automatic way. Stackless uses a
'green' or 'lightweight' threads model, all of the Stackless 'threads' run
in one process.

I did read some material when I was looking at it, about folks pickling
Stackless tasklets and passing them out to other servers to run. If you had
a multicore/processor machine, you could do something similar by running
multiple copies of your Stackless app on the same server.

Depending on what you are trying to do, you might just want to use real
python threads. On an OS that supports them, the OS will schedule the
threads across multiple processors or cores. Just make sure you understand
the Global Interpreter Lock and how it functions, so you understand the
impact on your app if any.

Last, you can just spawn actual child processes from your app. Pre 2.6 this
was a pain, you pretty much had to do this the way you would in C, but 2.6
and later have a nice module that abstracts process management to work like
Python threads.

Maybe if you let the group know the problem you need to solve, someone can
provide some better direction.

Cheers,

Brian


On Wed, Oct 28, 2009 at 3:36 PM, Bryan Harris <bryan.harris at udri.udayton.edu
> wrote:

> Has anybody on here had any experience with doing multiprocessor
> applications in Python in general or stackless-python in particular?
> --
> Bryan Harris
> Research Engineer
> Structures and Materials Evaluation Group
> bryan.harris at udri.udayton.edu
> http://www.udri.udayton.edu/
> (937) 229-5561
>
>
>
> _______________________________________________
> CentralOH mailing list
> CentralOH at python.org
> http://mail.python.org/mailman/listinfo/centraloh
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/mailman/private/centraloh/attachments/20091028/924587ba/attachment.htm>


More information about the CentralOH mailing list