[Swift-user] Re: [Swift-devel] Problem with iterate

Ben Clifford benc at hawaga.org.uk
Thu Feb 18 02:46:17 CST 2010


> Why was that flag 
> set to "not partial writer"?

I think that was a bug rather than some deep reason.

> How did iterate ever work? What am I missing?

I think it may have only ever worked in the initialise-in-nested-if case
(or fairly trivial test cases which don't run into this problem)

> Ideas?

I'm split between two minds:

 a) more static and runtime analysis can lead to some (informally 
    provable?) correct behaviour here. It think it might be possible to at 
    least detect deadlocks caused by this and more elegantly error out, by 
    finding cycles in a graph of who is waiting for what, which is a 
    better user experience than a deadlock (as in, you can type the 
    deadlock message into google and get the beautiful documentation page 
    all about resolving such problems)

 b) that having multiple writer arrays and foreach/iterate control 
    structures in their present for are (informally provably?) inherently 
    deadlock prone and no matter what is done, it will always be possible 
    to contrive a deadlock; and so then to have a "correct" system, those 
    structures need to fundamentally change.

Even if b is the case, it might be that problems are sufficiently obscure 
that it doesn't matter from the "lets run a bazillion protein folds" 
perspective.

-- 



More information about the Swift-user mailing list