]
Dimitris Andreadis updated JBAS-1182:
-------------------------------------
Assignee: Stefan Guilhen (was: Francisco Reverbel)
Re-assign older iiop tasks to Stefan, to review.
Thread creation during deactivate_object
----------------------------------------
Key: JBAS-1182
URL:
https://jira.jboss.org/jira/browse/JBAS-1182
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: IIOP service
Reporter: SourceForge User
Assignee: Stefan Guilhen
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: