[ale] Thread safe coding, Java or C

Phil Turmel philip at turmel.org
Sat Jul 20 01:14:20 EDT 2013


On 07/20/2013 12:05 AM, Dustin Strickland wrote:
> Ew, Java... How about Python? It's almost as effecient as C code, and has a
> decent built-in library for threads. 

You must be smoking something good...  the global interpreter lock in
python seriously impacts its ability to make effective use of multiple
cores unless your background threads spend the bulk of their time in
native libraries.

An in-depth treatment is here (by a python enthusiast):

http://jessenoller.com/blog/2009/02/01/python-threads-and-the-global-interpreter-lock

Neither java, nor C, nor C++ have such a problem.  (I generally use C
for such projects due to long familiarity.)

Phil


More information about the Ale mailing list