Alex Martelli wrote:
Istvan Albert [EMAIL PROTECTED] wrote:
Stéphane Ninin wrote:
Is a lock required in such a case ?
I believe that assignment is atomic and would not need a lock.
Wrong, alas: each assignment *could* cause the dictionary's internal
structures to be reorganized
Alex Martelli wrote:
Wrong, alas: each assignment *could* cause the dictionary's internal
structures to be reorganized (rehashed) and impact another assignment
(or even 'get'-access).
but wont the GIL be locked when the rehash occurs?
Regards
Sreeram
signature.asc
Description: OpenPGP
In [EMAIL PROTECTED], K.S.Sreeram
wrote:
Alex Martelli wrote:
Wrong, alas: each assignment *could* cause the dictionary's internal
structures to be reorganized (rehashed) and impact another assignment
(or even 'get'-access).
but wont the GIL be locked when the rehash occurs?
If there is a
Marc 'BlackJack' Rintsch wrote:
Wrong, alas: each assignment *could* cause the dictionary's internal
structures to be reorganized (rehashed) and impact another assignment
(or even 'get'-access).
but wont the GIL be locked when the rehash occurs?
If there is a GIL then maybe yes. But the
Alex Martelli wrote:
Wrong, alas: each assignment *could* cause the dictionary's internal
structures to be reorganized (rehashed) and impact another assignment
(or even 'get'-access).
(been thinking about this further...)
Dictionary get/set operations *must* be atomic, because Python makes
Marc 'BlackJack' Rintsch wrote:
It's not in Jython nor IronPython and maybe not forever in
CPython.
Whether or not a feature is present in Jython or IronPython does not
seem relevant, after all these languages emulate Python, one could
argue that it only means that this emulation is
K.S.Sreeram [EMAIL PROTECTED] wrote:
...
Consider two threads A and B, which are independent except for the fact
that they reside in the same module.
def thread_A() :
global foo
foo = 1
def thread_B() :
global bar
bar = 2
These threads create entries in the same
Istvan Albert [EMAIL PROTECTED] wrote:
Marc 'BlackJack' Rintsch wrote:
It's not in Jython nor IronPython and maybe not forever in
CPython.
Whether or not a feature is present in Jython or IronPython does not
seem relevant, after all these languages emulate Python, one could
Not at
Alex Martelli wrote:
Well then, feel free to code under such assumptions (as long as you're
not working on any project in which I have any say:-)
Hey, I would *never* write code which depends on such intricate
implementation details! Nonetheless, its good to *know* whats going on
inside. As
K.S.Sreeram [EMAIL PROTECTED] wrote:
...
Alex Martelli wrote:
Well then, feel free to code under such assumptions (as long as you're
not working on any project in which I have any say:-)
Hey, I would *never* write code which depends on such intricate
implementation details!
In article [EMAIL PROTECTED],
Istvan Albert [EMAIL PROTECTED] wrote:
Marc 'BlackJack' Rintsch wrote:
It's not in Jython nor IronPython and maybe not forever in
CPython.
Whether or not a feature is present in Jython or IronPython does not
seem relevant, after all these languages emulate Python,
Stéphane Ninin wrote:
Hello,
Probably a stupid question, but I am not a multithreading expert...
I want to share a dictionary between several threads.
Actually, I will wrap the dictionary in a class
and want to protect the sensitive accesses with locks.
The problem is I am not sure which
Istvan Albert [EMAIL PROTECTED] wrote:
Stéphane Ninin wrote:
Is a lock required in such a case ?
I believe that assignment is atomic and would not need a lock.
Wrong, alas: each assignment *could* cause the dictionary's internal
structures to be reorganized (rehashed) and impact another
13 matches
Mail list logo