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

Mihael Hategan hategan at mcs.anl.gov
Thu Feb 18 16:37:43 CST 2010


There is no existing value of b.

Here's the full example, which you can try out:

app (file y) cat(file x) {
	cat @x stdout=@y;
}

type file;

file a;
file b;

a = cat(b);
b = cat(a);

On Thu, 2010-02-18 at 16:17 -0600, Ioan Raicu wrote:
> But wouldn't the single assignment part prevent your example from
> dead-locking? In other words, the compiler should throw an error on
> line "b = cat(a)" as its trying to modify an existing value b.
> 
> Mihael Hategan wrote: 
> > On Thu, 2010-02-18 at 17:08 +0000, Ben Clifford wrote: 
> >   
> > > > I'm unsure. I have a feeling that static dealdock detection is
> > > > undecidable in swift. I need to think some more about that.
> > > >       
> > > I think doing it statically (i.e. at compile time) is equivalent to 
> > > executing the code (including external apps) - I think there's probably a 
> > > straightforward example where something depends on an integer read from an 
> > > externally executed app which then influences an if statement that decides 
> > > which of two different arrays is being written to; or something like that.
> > >     
> > 
> > Right. So termination is undecidable by virtue of it being a turing
> > complete language. What I'm unsure is whether deadlocks follow as a
> > consequence of that. They are a different beast.
> > 
> > We can probably start with simpler things. The following deadlocks with
> > the current swift:
> > a = cat(b);
> > b = cat(a);
> > 
> > So it seems that loops in the graph will create a deadlock and detecting
> > loops requires knowing the graph. We can probably detect the static
> > parts and we may be able to handle alternatives by issuing warnings of
> > the "branch 1 in that 'if' combined with branch 2 in that other 'if'
> > leads to a deadlock" sort.
> > 
> > Arrays may be a bit tougher.
> > 
> > 
> > _______________________________________________
> > Swift-devel mailing list
> > Swift-devel at ci.uchicago.edu
> > http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
> > 
> >   
> 
> -- 
> =================================================================
> Ioan Raicu, Ph.D.
> NSF/CRA Computing Innovation Fellow
> =================================================================
> Center for Ultra-scale Computing and Information Security (CUCIS)
> Department of Electrical Engineering and Computer Science
> Northwestern University
> 2145 Sheridan Rd, Tech M384 
> Evanston, IL 60208-3118
> =================================================================
> Cel:   1-847-722-0876
> Tel:   1-847-491-8163
> Email: iraicu at eecs.northwestern.edu
> Web:   http://www.eecs.northwestern.edu/~iraicu/
>        https://wiki.cucis.eecs.northwestern.edu/
> =================================================================
> =================================================================
> 




More information about the Swift-user mailing list