Re: Calling wait() in a handleGet in a Resource, blocks all other requests?

2008-06-21 Thread Tim Peierls
On Fri, Jun 20, 2008 at 10:14 PM, Guillermo Cantu [EMAIL PROTECTED] wrote: My problem is that I need a pool manager to control the number of instances of a 3rd party library that are loaded to service the requests. Each request needs an instance of the 3rd party library. So let's say I can

Re: Calling wait() in a handleGet in a Resource, blocks all other requests?

2008-06-21 Thread Tim Peierls
On Sat, Jun 21, 2008 at 9:35 AM, Tim Peierls [EMAIL PROTECTED] wrote: While it's currently true of Restlet that each Resource instance is confined to a single thread, this may change in the future, so it would be unwise to rely too heavily on it. Getting a litle OT, here's a utility that can

Re: Calling wait() in a handleGet in a Resource, blocks all other requests?

2008-06-21 Thread Joe Nellis
Hi Guillermo, The wait loop idiom: synchronized(obj){ while( condition does not hold ){ obj.wait(); // do stuff we were waiting for } Without the loop, your threads wait automatically and depend on obj.notify getting called from some control thread, which I think is never happening or

Re: Calling wait() in a handleGet in a Resource, blocks all other requests?

2008-06-21 Thread Rob Heittman
Joe's resource ticket approach is really extra helpful if something can take an undefined length of time in the third party library operation (depending on load, task size, etc), that might exceed client or server timeouts, leading to hard-to-diagnose intermittent failures at runtime. - R