Threaded GUI slowing method execution?

Ole Streicher ole-usenet-spam at gmx.net
Fri Oct 2 14:19:35 EDT 2009


sturlamolden <sturlamolden at yahoo.no> writes:
> On 2 Okt, 13:29, Dave Angel <da... at ieee.org> wrote:
> If you are worried about speed, chances are you are not using Python
> anyway.

I *do* worry about speed. And I use Python. Why not? There are powerful
libraries available.

> If you still have "need for speed" on a multicore, you can use Cython
> and release the GIL when appropriate. Then launch multiple Python
> threads and be happy.

Usually this is not an option: numpy is AFAIK not available for Cython,
neither is scipy (ofcourse).

Especially for numeric calculations, speed *matters*.

> Using more than one process is always an option, i.e. os.fork if you
> have it or multiprocessing if you don't. Processes don't share GIL.

Not if the threads/processes need to share lots of data. Interprocess
communication can be very expensive -- even more if one needs to share
Python objects. Also, the support of sharing python objects between
processes seems to me not well supported at least by the standard python
libs.

Ole



More information about the Python-list mailing list