logo       

Re: [osol-discuss] Python on Solaris Lacking Multiprocessing Support?: msg#00869

opensolaris-discuss

Subject: Re: [osol-discuss] Python on Solaris Lacking Multiprocessing Support?

> Also, beware of the Global Interpreter Lock.
>
> http://raymondtay.blogspot.com/2008/11/python-performa
> nce-and-gil.html

I only glanced over the article because I am aware of the issues around the GIL
and threads. The multiprocessing module is a great work-around for this.
http://docs.python.org/library/multiprocessing.html

Instead of parallel execution in threads (which is impossible due to the GIL),
parallel execution happens in processes instead. Some overhead is incurred
because each process has it's own stack/heap etc, and IPC is a little slower
than in process locking semantics, but for most applications the overhead is
negligible.

When OS semaphores are detected correctly when building python, you get some
nice features in the multiprocessing package for synchronization such as
synchronized queues. Without the semaphores, you can still synchronize your
processes on but it is a little harder because you have to use pipes or other
mechanisms.

-John
--
This message posted from opensolaris.org
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@xxxxxxxxxxxxxxx

Google Custom Search

News | Mail Home | sitemap | FAQ | advertise