[CentralOH] Fwd: Re: Stackless Python

Brian Costlow brian.costlow at gmail.com
Wed Oct 28 22:16:56 CET 2009


I should take my own advice :)

The GIL *won't* let python threads run across multiple cores, so even if the
os thread model supports it, cpython can't take advantage. I didn't realize
the GIL was that intrusive.

You could try running your app in Jython which does not have a GIL.

Or rewrite it to use multiple processes.





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

>
>
> >Maybe if you let the group know the problem you need to solve, someone can
> >provide some better direction.
>
>
> I have written a long script which takes a whole directory of stress-strain
> test data, massages it, and spits out a new data file along with a bunch of
> images of the results. I wrote a multi-threaded version a while back, but it
> actually ran much slower than the single thread version and I noticed it
> never used more than one processor at a time.
>
>
> Maybe I did something wrong. It performed slower on a single or a
> multiprocessor machine. I noticed the same behavior on my development
> machine, Ubuntu linux and on a windows machine in the lab. In theory, it
> ought to be able to do file i/o on one file while the other crunches on
> calculations, thus saving time. It didn't work that way though.
>
>
>
>
> _______________________________________________
> 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/f8fd0116/attachment.htm>


More information about the CentralOH mailing list