On Mon, Apr 27, 2009 at 12:51 PM, Tammo van Lessen <[email protected]>wrote:

> Matthieu Riou wrote:
> > You can't start a thread that will do something at the Jacob level. When
> you
> > think of it, the main purpose of Jacob is to avoid multi-threading by
> using
> > a cooperative and lightweight threading model. The way you do parrallel
> > stuff in Jacob is by injecting more threads.
> >
> > So I guess the question becomes: what do you need a thread for in your
> > extension?
>
> For non-blocking extension activities. AFAIK a new thread is the only
> way to run the extension code independently from the jacob loop.
> Long-running code in JacobRunnable.run() would block the whole
> navigation. Instead, this code can run in a different thread and mark
> the activity completed once its finished. That's at least what I had in
> mind. So I guess we'd need to find a way to synchronize both threads?
>
> Would there be a more elegant way to generically allow for custom
> long-running code?
>

I think so yes. We should probably have a specific channel for extension
activities that extension runnables could listen to (accepting any
Serialzable for example). Then external code could fire the channel when the
async processing is done. It'd look very much like what we're doing for all
BPEL activities right now and would probably be easier than greenspuning
Java multi-threading in Jacob.

Makes sense?

Cheers,
Matthieu


>
> Cheers,
>   Tammo
>
> --
> Tammo van Lessen - http://www.taval.de
>

Reply via email to