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 em
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! No
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 th
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
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
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 incomplet
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:
>>> 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.
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
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 di
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
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 a
Stéphane Ninin wrote:
> Is a lock required in such a case ?
I believe that assignment is atomic and would not need a lock.
yet most of the other dictionary use cases are not threadsafe. For
example I suspect that you'd get an error if you were iterating through
the dictionary while another threa
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
14 matches
Mail list logo