Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-1182

Thread creation during deactivate_object

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • No Release
    • None
    • IIOP service
    • None

    Description

      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()
        Unknown macro: { public void run() { _remove( @@ -361,8 +380,8 @@ ); } }

        ;
        -

      • thread.start();
        +
        + deactivationPool.putJob(job) ;
        }

      Attachments

        Activity

          People

            sguilhen Stefan Guilhen
            sourceforge-user SourceForge legacy user (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: