[ http://jira.jboss.com/jira/browse/JBAS-1182?page=history ]
Scott M Stark reassigned JBAS-1182: ----------------------------------- Assign To: Francisco Reverbel (was: Scott M Stark) > Thread creation during deactivate_object > ---------------------------------------- > > Key: JBAS-1182 > URL: http://jira.jboss.com/jira/browse/JBAS-1182 > Project: JBoss Application Server > Type: Bug > Components: IIOP service > Reporter: SourceForge User > Assignee: Francisco Reverbel > > > SourceForge Submitter: kevinconner . > This is a duplicate of bug 527 in the JacORB database. > It is being submitted here so that a patch may be > applied to the JBoss patched version of JacORB. > http://www.jacorb.org/cgi-bin/bugzilla/show_bug.cgi?id=527 > The deactiviation of an object causes Thread creation > in AOM.remove. Would it > be possible to use a thread pool instead of creating > new threads? > A possible solution could be to have the > RequestController provide a > notification mechanism (instead of a thread waiting on > object completion) and > have the notification request work from the thread pool. > The attached patch uses a threadpool to prevent the > thread creation but I don't > believe it is the best solution. > Index: AOM.java > =================================================================== > RCS file: > /cvsroot/jacorb/JacORB/src/org/jacorb/poa/AOM.java,v > retrieving revision 1.29 > diff -u -r1.29 AOM.java > --- AOM.java 6 May 2004 12:40:00 -0000 1.29 > +++ AOM.java 21 Oct 2004 14:38:11 -0000 > @@ -27,6 +27,9 @@ > import org.jacorb.poa.util.ByteArrayKey; > import org.jacorb.poa.util.POAUtil; > import org.jacorb.poa.util.StringPair; > +import org.jacorb.util.threadpool.Consumer; > +import org.jacorb.util.threadpool.ConsumerFactory; > +import org.jacorb.util.threadpool.ThreadPool; > > import > org.omg.PortableServer.POAPackage.ObjectAlreadyActive; > import org.omg.PortableServer.POAPackage.ObjectNotActive; > @@ -69,6 +72,23 @@ > /** a lock to protect two consecutive operations > on the list, used > in remove() */ > private Object deactivationListLock = > new Object(); > + > + private Consumer deactivationConsumer = new > Consumer() { > + public void doWork(final Object job) { > + try { > + ((Runnable)job).run() ; > + } catch (final Throwable th) { > + logger.info("Unhandled exception > during deactivation", th); > + } > + } > + } ; > + private ConsumerFactory > deactivationConsumerFactory = new ConsumerFactory() { > + public Consumer create() { > + return deactivationConsumer ; > + } > + } ; > + > + private ThreadPool deactivationPool = new > ThreadPool(deactivationConsumerFactory) ; > > private AOM() > { > @@ -348,8 +368,7 @@ > final POA poa_ = poa; > final boolean cleanupInProgress_ = > cleanupInProgress; > > - Thread thread = new Thread("AOM_RemovalThread") > - { > + final Runnable job = new Runnable() { > public void run() > { > _remove( > @@ -361,8 +380,8 @@ > ); > } > }; > - > - thread.start(); > + > + deactivationPool.putJob(job) ; > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ JBoss-Development mailing list JBoss-Development@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-development