commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kohsuke Kawaguchi ...@kohsuke.org>
Subject [javaflow] Continuation.startSuspendedWith(Runnable)
Date Sat, 13 Aug 2005 21:47:12 GMT

Torsten,

While implementing the workflow engine, I found that it's convenient to 
be able to create a Continuation without actually executing it. This is 
analogous to creating a thread in a suspended state.

While this can be easily emulated by wrapping the Runnable into the 
following Runnable,

	new Runnable() {
		public void run() {
			Continuation.suspend();
			realTarget.run();
		}
	}

it's bit convenient and faster/easier to do so in the javaflow itself, 
because all I need to do is:

         return new Continuation(new StackRecorder(target));

In Win32 thread API one can create a thread in a suspended state, so at 
some people seem to find that this is a generally useful feature. OTOH, 
POSIX thread API doesn't have the equivalent AFAIK, nor 
java.lang.Thread. So I'm not quite sure if this code should live in 
javaflow or I should keep it on my side.

So I don't feel strongly either way, but if you are OK with putting this 
change into javaflow, just because it's easier than the other approach.

-- 
Kohsuke Kawaguchi

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message