Re: "RuntimeError: dictionary changed ... & Ruby

2006-03-13 Thread Alex Martelli
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, robert wrote: > > > * Ruby without refcounts provides no deterministic __del__ in > > non-circular refs ==> your type finally finally finally .close .close > > .close all the time > > Which is what you should type in

Re: "RuntimeError: dictionary changed ... & Ruby

2006-03-13 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, robert wrote: > * Ruby without refcounts provides no deterministic __del__ in > non-circular refs ==> your type finally finally finally .close .close > .close all the time Which is what you should type in Python too as there's no guarantee that `__del__()` will be calle

Re: "RuntimeError: dictionary changed ... & Ruby

2006-03-11 Thread Alex Martelli
robert <[EMAIL PROTECTED]> wrote: ... > What? When I add/del an item to a dict or list, this is not an atomic > thread-safe operation? Exactly: there is no such guarantee in the Python language. > E.g.: > One thread does things like d['x']='y' > Another thread reads d['z'] or sets d['z']='w'

Re: "RuntimeError: dictionary changed ... & Ruby

2006-03-11 Thread Felipe Almeida Lessa
Em Sáb, 2006-03-11 às 23:44 +0100, robert escreveu: > > Farwell and best of luck in finding other languages which support > > threads in a way that is more to your liking than Python -- maybe Ruby > > suits you, I don't know for sure though. > > I looked several times on Ruby, but stay with Python

Re: "RuntimeError: dictionary changed ... & Ruby

2006-03-11 Thread robert
Alex Martelli wrote: > robert <[EMAIL PROTECTED]> wrote: >... > >>99.99% no. I would have to use a lock everywhere, where I add or remove >>something into a dict or list of the struct. Thats not the purpose of >>big thread locks. Such simple operations are already atomic by the >>definition