[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Thread safe coding, Java or C
- Subject: [ale] Thread safe coding, Java or C
- From: philip at turmel.org (Phil Turmel)
- Date: Sat, 20 Jul 2013 01:14:20 -0400
- In-reply-to: <CAHWNiXyqXFtZPXF3iJ5we0DFnGb+psny7DY=7E+Zj2kOi6Opdw@mail.gmail.com>
- References: <[email protected]> <CAAt=rgDLBef8daDgH4R5nz-5QCKqJ=Ct2e3BqT7iSkbhT3R7jQ@mail.gmail.com> <CADvA-d=+3c56zunDTkjVEKmMfkkBBie++8zp1K3=o7VzoPJqRQ@mail.gmail.com> <CAHWNiXyqXFtZPXF3iJ5we0DFnGb+psny7DY=7E+Zj2kOi6Opdw@mail.gmail.com>
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