Making python C-API thread safe (try 2)

Aahz aahz at pythoncraft.com
Mon Sep 15 01:36:50 EDT 2003


In article <pdb9mv42covtudsfnfj02lakbniufabt6t at 4ax.com>,
Gary Feldman  <gafStopSpamData at ziplink.stopallspam.net> wrote:
>
>The main benefit of threads is performance.  Sharing data among
>the threads is often faster than sharing data among processes (you
>don't need to deal with shm_get, etc. for sharing memory on UNIX
>systems).  Locking the shared data is likewise often faster.  Finally,
>my understanding of the MS Windows world is that threads as a general
>rule are more efficient than processes.

The main disadvantage of free-threading lies with external libraries
that are not thread-safe (not even talking about thread-hot).  It's
*much* easier to work with external libraries that are explicitly
designed to work with Python's threading system.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"It is easier to optimize correct code than to correct optimized code."
--Bill Harlan




More information about the Python-list mailing list