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

Mihael Hategan hategan at mcs.anl.gov
Fri Feb 19 11:34:39 CST 2010


On Fri, 2010-02-19 at 10:59 -0600, Ioan Raicu wrote:
> But lets bring this back to a more real example. A user wanting to
> express some computations that have some dependencies, would write out
> their computations in some order, expecting their order to be
> preserved because of the dependencies. If you only support single
> assignment on variables (e.g. the data), then an example like the one
> below could never deadlock because the single assignment would be
> violated on the 2nd statement. Perhaps things are more complicated if
> you support multiple assignments per variables, but that is not the
> case for Swift, right? 

x = y + 1
y = x + 1

How many assignments are there? 2
How many variables are being assigned? 2
Do those assignments have the same lvalue (thing on the left)? no
---
Conclusion: each variable is assigned exactly once.

> 
> I am trying to understand if this deadlock is happening in Swift due
> to some particular implementation detail in Swift (or underlying
> pieces), or is it a fundamental flaw in the DAG based approach with
> single assignment variables? Or is it due to something completely
> different?

It seems to be a fundamental flaw with computers and algorithms.




More information about the Swift-user mailing list