Multi-threaded ORBit2 comments



Hi,

Just some naive comments on the current status of multi-thread support
in ORBit2. No more than one thread was spawned in the following
experiments.

I have been experimenting with ORBit2 and multi-threading. The
conclusion is that it is presently impossible unless ORB_init(), ORB_run
() and the servant all lives in the same thread. Not necessarily the
main thread though.

I have tried to put ORB_init() in a separate thread, but the server
process hangs while handling a request. 

I have also tried to put the servant in a separate thread but keep
ORB_init() and ORB_run() in the main thread. More promising results,
requests are handled just fine, but references are leaked on exit and a
FREE_MEM exception is thrown from ORB_destroy().

It does not seem entirely trivial to fix these issues, maybe not even
necessary, but it would be nice if we could put servants in other
threads than the one in which the ORB is living in.


Best regards,
  jules


BTW: I applied the following very experimental patch to make it possible
to do my experiments:

? mt.patch
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/ORBit2/ChangeLog,v
retrieving revision 1.688
diff -u -r1.688 ChangeLog
--- ChangeLog	8 Feb 2005 22:11:19 -0000	1.688
+++ ChangeLog	9 Feb 2005 12:10:40 -0000
@@ -1,3 +1,8 @@
+2005-02-09  Jules Colding  <colding omesc com>
+
+	* src/orb/GIOP/giop.c (giop_main_run): Allow ORB_run() to be
+	invoked from another thread than ORB_init().
+
 2005-02-08  Tor Lillqvist  <tml novell com>
 
 	* orbit2-zip.in: New file, expands to a script to be used for
Index: src/orb/GIOP/giop.c
===================================================================
RCS file: /cvs/gnome/ORBit2/src/orb/GIOP/giop.c,v
retrieving revision 1.51
diff -u -r1.51 giop.c
--- src/orb/GIOP/giop.c	28 Jan 2005 15:46:50 -0000	1.51
+++ src/orb/GIOP/giop.c	9 Feb 2005 12:10:40 -0000
@@ -631,7 +631,8 @@
 giop_main_run (void)
 {
 	if (giop_thread_io ()) {
-		g_assert (giop_thread_self () == giop_main_thread);
+		if (!giop_thread_safe ())
+			g_assert (giop_thread_self () == giop_main_thread);
 		g_assert (giop_main_loop == NULL);
 		giop_main_loop = g_main_loop_new (NULL, TRUE);
 		g_main_loop_run (giop_main_loop);




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]