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

Mihael Hategan hategan at mcs.anl.gov
Tue Apr 21 10:46:19 CDT 2009


On Tue, 2009-04-21 at 15:23 +0000, Ben Clifford wrote:
> 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?

Not really. As long as no two threads with the same ID execute at the
same time.

Though I'd prefer something like an iteration counter rather than
[.666]*.

> 
> Thus far everything seems to be working for me.
> 




More information about the Swift-devel mailing list