activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Is there a good reason for having a static Executor for Sessions shared across all Connections?
Date Thu, 03 Aug 2006 11:09:32 GMT
I'm just investigating a Lingo test case (LINGO-22) submitted by Jim
Beattie which tests that we leave no threads around after shutting
down lingo & ActiveMQ - which sounds good to me.

I've noticed that the Executor for all connections is a static and
shared across connections. I was gonna make it so that after all
connections are closed all threads are cleanly shutdown - I've a
refactor of Jim's test case to test for this.

I just wondered before I go ahead and change things - was there a good
reason to keep the TaskRunnerFactory / Executor a singleton? I was
thinking of creating one per connection. Failing that we could keep it
a singleton and just reference count the connections so we can close
it when the last connection goes away

Am wondering if this was an optimisation to minimise context switching
when using lots of sessions - or is it just an oversight?
-- 

James
-------
http://radio.weblogs.com/0112098/

Mime
View raw message