Right, Tim. My request handling thread is doing the aggregation. Thanks for verifying!
Marc On Thu, Jan 14, 2010 at 9:04 AM, Tim Peierls <[email protected]> wrote: > On Thu, Jan 14, 2010 at 11:24 AM, Marc Limotte <[email protected]>wrote: > >> My multi-threaded request seems to work otherwise. I'm >> using ExecutorCompletionService and ThreadPoolExecutor from the >> Java Concurrency package. >> > > One thing to be careful of, as Thierry hinted, is that a ServerResource > instance itself is not generally safe for concurrent access, so if it does > have mutable state that you need to access from a worker thread, you'll need > to add some kind of synchronization. > > But since you mentioned ExecutorCompletionService, you're probably doing > the aggregation of results in the request handling thread and *not* > accessing mutable state of the ServerResource in the worker threads -- in > which case you should be fine. > > --tim > ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2437346

