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
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
: Exception: current thread not owner
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
Hi,
[Robert Harper]
I still need to know how I am to wait without burning the CPU while I
am
waiting
for a response. I would rather not have to have the web page have to
keep
checking back for a response.
It's been a while since I've had to post code on here ;) Here's a
generic way to spawn a
It's been a while since I've had to post code on here ;) Here's a
generic way to spawn a thread and only check on it every X milliseconds,
instead of all the time, so that you don't burn the CPU:
[Robert Harper]
I know how to create threads. I did not intend for you to treat me like a total
Hi,
I still don't see how I have the servlet check back every so many ms
for an
event or a status flag to be set without performing some sleep() or
wait()
without burning CPU.
I don't get it. You don't want the servlet to return until it's done
writing the web page, which means waiting for
I still don't see how I have the servlet check back every so many ms
for an
event or a status flag to be set without performing some sleep() or
wait()
without burning CPU.
His code wasn't without a sleep() call.
On Mon, 2004-10-18 at 16:02, Robert Harper wrote:
It's been a while