[Swift-devel] karajan futures and getfieldvalue/setfieldvalue

Ben Clifford benc at hawaga.org.uk
Sun Nov 16 01:37:12 CST 2008


While playing round with how setfieldvalue works, I came across the 
following; I don't understand enough about how karajan deals / is meant to 
deal with futures to see what is going on.

The attached attach, error.patch, is intended to amend the behaviour of 
Swift HEAD so that getFieldValue is not used to get an unwrapped 
(not-in-DSHandle) value to pass into SetFieldValue.

The attached patch test.patch contains a test, test.swift, which appears 
to work repeatedly on swift/cog HEAD but fails often on my laptop with 
error.patch applied (although sometimes works).

Changing the number of assignment steps in test.swift changes the 
likelihood that the execution will fail - more steps = higher probability 
of failure (which makes sense as there is a race to get the circumstances 
that trigger this).

It looks like if SetFieldValue throws a FutureNotYetAvailable exception, 
then this does not have the same behaviour of deferring execution and 
rerunning later, as when GetFieldValue throws a FutureNotAvailable 
exception which seems to work ok.

There is an execution log for a failed log at
http://www.ci.uchicago.edu/~benc/test-20081116-0133-vr84izb8.log

(btw When running this test on two different versions, don't forget to 
force a recompile: touch test.swift && swift test.swift)

-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: error2.patch
Type: text/x-diff
Size: 2366 bytes
Desc: 
URL: <http://lists.mcs.anl.gov/pipermail/swift-devel/attachments/20081116/50e30a72/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.patch
Type: text/x-diff
Size: 307 bytes
Desc: 
URL: <http://lists.mcs.anl.gov/pipermail/swift-devel/attachments/20081116/50e30a72/attachment-0001.patch>


More information about the Swift-devel mailing list