[jboss-jira] [JBoss JIRA] Updated: (JBAS-1182) Thread creation during deactivate_object
Dimitris Andreadis (JIRA)
jira-events at jboss.com
Fri Jul 14 10:35:11 EDT 2006
[ http://jira.jboss.com/jira/browse/JBAS-1182?page=all ]
Dimitris Andreadis updated JBAS-1182:
-------------------------------------
Comment: was deleted
> Thread creation during deactivate_object
> ----------------------------------------
>
> Key: JBAS-1182
> URL: http://jira.jboss.com/jira/browse/JBAS-1182
> Project: JBoss Application Server
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: IIOP service
> Reporter: SourceForge User
> Assigned To: Francisco Reverbel
> Fix For: JBossAS-4.0.5.CR1
>
>
> 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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list