On 06/08/2015 08:10 PM, MinRK wrote:
>
>
> On Mon, Jun 8, 2015 at 11:00 AM, Arnaud Loonstra <arn...@sphaero.org
> <mailto:arn...@sphaero.org>> wrote:
>
>     A python dictionary is not thread safe, AFAIK. So if multiple
>     producers(threads) write to the dictionary you'll run into trouble.
>
>
> Depends what you mean. All of Python is threadsafe, thanks to the GIL.
> Since object IDs are unique as long as the objects exist, you should
> have no collisions putting different objects in the dictionary from
> different threads. You could also key by UUID if for some reason you
> have multiple threads sending the same exact object.
>
> -MinRK

You could be right indeed. To operate on the dictionary only one GIL 
lock needs te be acquired since it is a native type. Then indeed you can 
share a single dictionary.

-- 
w: http://www.sphaero.org
t: http://twitter.com/sphaero
g: http://github.com/sphaero
i: freenode: sphaero_z25
_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to