Adding a Par construct to Python?
aahz at pythoncraft.com
Wed May 20 18:16:39 EDT 2009
In article <mailman.449.1242835175.8015.python-list at python.org>,
Luis Zarrabeitia <kyrie at uh.cu> wrote:
>On Monday 18 May 2009 10:31:06 pm Carl Banks wrote:
>> Even if you decided to accept the penalty and add locking to
>> refcounts, you still have to be prepared for context switching at any
>> time when writing C code, which means in practice you have to lock any
>> object that's being accessed--that's in addition to the refcount lock.
>While I agree that the GIL greatly simplifies things for the
>interpreter, I don't understand this statement. In practice, you should
>lock all critical sections if you expect your code to be used in a
>multithreading environment. That can't be different from what Java, C#
>or any other languages do, including C++. Why is that so expensive in
>python extensions, that it is used as an argument against removing the
Python is intended to be simple/easy to integrate with random C
libraries. Therefore you have to write explicit code from the C side in
order to drop the GIL.
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"A foolish consistency is the hobgoblin of little minds, adored by little
statesmen and philosophers and divines." --Ralph Waldo Emerson
More information about the Python-list