Oops; didn't make it out the first time.

> Subject: Re: Threads question (Concrete examples?)
> Date: Thu, 09 Mar 2000 16:42:40 -0500
> From: Laird Nelson <[EMAIL PROTECTED]>
> Organization: Perot Systems Corporation (http://www.perotsystems.com)
> To: [EMAIL PROTECTED]
> CC: [EMAIL PROTECTED]
> References: <[EMAIL PROTECTED]@dano>
>
> Dan OConnor wrote:
> > Since JMS seems to be the answer whenever threads are the
> > question, advocates for a threading API might want to point out
> > specifically where JMS fails to provide the equivalent logical
> > operations.
>
> Suppose I take the example proffered before of a car rental application
> (at least I think that's what it was).  There was parallel access to
> three or four legacy systems involved, if I recall correctly.  Suppose I
> do this via JMS.  In my session bean, I do the following operations:
>
>   publish message 1 (returns immediately)
>   publish message 2 (returns immediately)
>   publish message 3 (returns immediately)
>   block and wait for all return messages from subscribers
>
> Now suppose that the subscriber to message 1, who is responsible,
> out-of-band, for hooking up to legacy system 1, hangs indefinitely or
> crashes or at least never publishes back a response to message 1.  My
> session bean will block in step 4 forever, waiting for the response.
>
> Contrast this with:
>
>   start thread 1 (returns immediately)
>   start thread 2 (returns immediately)
>   start thread 3 (returns immediately)
>   join() with all threads
>
> If thread1 throws an exception or cannot proceed, he will exit--he will
> exit badly, to be sure, but the join() will still "work" at the end,
> i.e. the hypothetical session bean that's doing the join() will not
> hang.
>
> Does that make sense?
>
> Cheers,
> Laird

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to