News

muvee Reveal - the latest incarnation of muvee's flagship product - has just been released on 11 June 2008! The behaviours of the 8 bundled styles are specified using muSE, in addition to all the styles developed for the now discontinued muvee autoProducer 6.1.

Thursday, December 14, 2006

Continuations and processes

The call/cc implementation has been revamped to make continuations work only within the processes in which they were captured. This is because none of the alternatives to supporting inter-process continuation invocation seemed clean enough or necessary.

What should happen when a process invokes a continuation that was captured by another process? Should it terminate the current process and join with the process to which the continuation belongs? If that's the case, what about the continuations that were captured in the invoking process? Should they be rendered invalid? Would this whole spaghetti be useful or meaningful?

An alternative is to have the continuation invocation finish evaluation in the invoking process and return with a value like nil or T. Doing that, however, means different behaviour when invoking a continuation in the same process it was captured in versus invoking a continuation captured in a different process. In the former case the invocation never completes evaluation whereas in the latter case it does.

Due of all of that, I've disabled invocation of continuations across process boundaries. Any possible use for that can be satisfied by the message passing mechanism (I think), which is simpler and more comprehensible anyway.

3 comments:

shaurz said...

This might be an interesting read. It deals with mixing continuations and threads.

http://citeseer.ist.psu.edu/kumar97threads.html

Kumar said...

Interesting indeed and thanks for the link. Strangely, that paper seems to confirm my decision to not allow continuation invocation to cross process boundaries 'cos there is not much to be gained there over in-process continuations + inter-process message passing. Besides, in muSE, continuation invocation and process switching have only a (to some extent) artificial distinction any way.

However LtU blog) pointed out that continuation invocation across processes would mean that the current process becomes a clone of the process' state at the time the continuation was captured. I'm currently pursuing that trail of thought.

Kumar said...

I meant to say "Felicia Li Svilling (on the LtU blog) pointed out" but Google screwed it up.