On Wed, 3 Sep 2003, Leopold Toetsch wrote:

> Dan Sugalski <[EMAIL PROTECTED]> wrote:
> > On Wed, 3 Sep 2003, Leopold Toetsch wrote:
> 
> >> Then we might get deadlocks.
> 
> > This is always a possibility, and there isn't anything we can do about it
> > at the interpreter level. Deadlocks are an unfortunate fact of life in a
> > threaded environment.
> 
> clone() isn't supposed to deadlock, nor freeze(), nor dump(). They
> officially do not change (or shouldn't change) anything in the PMCs they
> operate on. These methods just passively iterate over PMCs.

It's impossible to have clone in a threaded environment guarantee that it 
won't deadlock. Can't do it. If there's more than one shared PMC in the 
set of PMCs that need freezing, then there exists the possibility of 
deadlock. You can't prescan the PMC list either, since you can't guarantee 
that shared PMCs won't change between the time of the scan and the actual 
clone. (Unless you lock, and then you're running the risk of deadlock)
 
There's no such thing as passively iterating over shared PMCs. 

                                        Dan

Reply via email to