ode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dong Liu" <edong...@gmail.com>
Subject Re: How does the server control the threads?
Date Thu, 12 Oct 2006 21:27:40 GMT
Hi, Maciej,

Let's look at the following process. I assign a name there for easy discussion.
<process>
    <sequence1>
           <receive1/>
           <invoke1/>
           <flow1>
                  <sequence2>
                          <invoke2/>
                          <receive2/>
                  </sequence2>
                  <sequence3>
                          <invoke3/>
                  </sequence3>
           </flow1>
           <reply1/>
    </sequence1>
</process>

The servlet container will assign a thread (thread1) on receive1, and
thread1 will continue for invoke1. Will it continue for flow1? Or will
it end there and return to the thread pool?
It seems there have to be thread2 to take care of sequence2 and
thread3 to take care of sequence3. Will thread2 and thread3 end when
sequence2 and sequence3 finished?
Which thread will carry out reply1 at the end?

Cheers,

Dong

On 10/12/06, Maciej Szefler <mbs@intalio.com> wrote:
> Dong,
>
> Not quite. If you have a trivial process:
> <process>
> <sequence>
> <receive/>
> <reply/>
> </sequence>
> </process>
> Then yes, what you say is true. If you add some assginments between
> receive/reply then it remains true. However if you were to stick another
> <receive> in there, then when the process hits the <receive> it would end
> processing and return a status code "ASYNC" to the caller. The processing of
> the process would resume in a seperate thread (the one that actually
> provides the message for the second receive). If you had a <wait> in there,
> or some other sort of timeout (e.g. a pick with a timeout), then the
> processing of the process could resume in one of the scheduler threads.
>
>
> -Maciej
>
> On 10/12/06, Dong Liu <edongliu@gmail.com> wrote:
> >
> > Thank you, Maciej.
> >
> > Based on your answer, I guess that the servlet container will provide
> > an available thread for each incoming service request which initialize
> > the process instance, and then this thread will be active and take
> > care of the process instance through its lifetime. Is this correct?
> >
> > Cheers,
> >
> > Dong
> >
> > On 10/11/06, Maciej Szefler <mbs@intalio.com> wrote:
> > > There's two primary sources of threads in the ODE engine:
> > >
> > > 1) Job Scheduler - This is the component that schedules all of the
> > engine's
> > > internal threads. There is a (default) implementation of the Job
> > Scheduler
> > > that uses an ExecutorService and Quartz Scheduling.
> > >
> > > 2) Integration Layer - The integration layer between ODE and the outside
> > > world can also create threads (e.g. if a message is delivered to the
> > engine,
> > > it is processes in the thread that delivered it). There are two
> > different
> > > integration layers, one for AXIS, and one for JBI. The AXIS integeration
> > > layer relies on the threads provided by the servlet container (when a
> > web
> > > serviceis invoked, a TCP listener thread will receive the request and
> > invoke
> > > ODE engine core, where the message is processed to the extent possible
> > in
> > > the current (TCP listener) thread). The JBI layer has it's own thread
> > pool
> > > and thread for polling the delivery channel.
> > >
> > > Finally there are those threads that are used to invoke PMAPI (Process
> > > Management API) methods. These can be invoked via WebService call, in
> > which
> > > case the servlet container's threads are used. Also they can be invoked
> > via
> > > RMI, in which case the RMI threads are used.
> > >
> > > All threads performing work on behalf on the engine will fall into one
> > of
> > > those categories.
> > >
> > > -mbs
> > >
> > > On 10/11/06, Dong Liu <edongliu@gmail.com> wrote:
> > > >
> > > > Hi,
> > > >
> > > > I am looking for a document about how the ode server handles the
> > > > threads. Please give to me a link, if you know such an architecture
> > > > document. Or tell me something about how threads work in ode server. I
> > > > guess there should be a thread pool, and the server assign an
> > > > available thread for each process instance. Am I right?
> > > >
> > > > Cheers,
> > > >
> > > > Dong
> > > > --
> > > > Dong Liu
> > > > http://blogs.usask.ca/dong_notes/
> > > >
> > >
> > >
> >
>
>

Mime
View raw message