[Swift-devel] karajan thread IDs as surrogates for swift execution IDs

Ben Clifford benc at hawaga.org.uk
Tue Apr 21 10:23:50 CDT 2009


In the provenance work that I am doing for Swift, I have been using the 
karajan thread ID to identify a lot of things, on the assumption that 
every distinctly identifiable swift call gets its own karajan thread ID.

This fails in two places: compound procedures which run only a single 
statement - in that case, a new karajan thread is not started, and the 
same thread is used for both the containing and the contained procedure; 
and iterate(){} which runs each iteration in sequence in the same thread.

For the purposes of my immediate development, I have hacks that look like 
this:

                        // starting new iteration
+               ThreadingContext tc = 
(ThreadingContext)stack.getVar("#thread");
+               stack.setVar("#thread", tc.split(666));

so that the thread ID is different for each iteration (though in a rather 
longwinded format using church numerals to number the iterations).

Can I expect things to break or work if I make changes to the thread ID?

Thus far everything seems to be working for me.

-- 



More information about the Swift-devel mailing list