long overtime = System.currentTimeMillis() + timeout_ms;
while (System.currentTimeMillis() < overtime) {
if (isResponseAvailable()) {
return true;
} else {
synchronized(this) {
try {
this.wait(100);
} catch (InterruptedException e) {}
}
}
}We might want to put a little more effort into determining how long to wait, but the idea is the same.
Mike
Oleg Kalnichevski wrote:
I am not sure.
We do not need down to ms precision there. We might put the thread to sleep for 10 to 25 ms prior to polling for data again. I would see it as lesser of two evils
Oleg
On Thu, 2003-02-27 at 15:36, Ortwin Gl�ck wrote:
Oleg Kalnichevski wrote:
Odi, are you sure you want to have an extra thread per HttpMethod? I do not think so Oleg
Better than a busy wait, isn't it?
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
