Hi,

>process a request. This request is asynchronous and I have to wait for
the
>output before I can continue. When I try to put a wait( 1000 ) line in
my
>code I
>get the exception that I am not the owner of the current thread. How
can I
>set
>up a wait so I don't burn CPU in a tight loop?

Yup, you don't own the request processing thread, Tomcat does.  If you
blocked it, other requests couldn't use it.

You'd still have to use a loop (assuming you're not interested in a
design-driven solution like JMS or another event-driven model), but you
can make it less tight by checking every X ms instead of all the time,
and you can do it in a separate thread that you spawn.  Unlike the
server threads, you'd own that thread so you could sleep or wait it as
needed.

Yoav



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to