threading woes



Hi,

I received a request for some help on the orbitcpp-list. It relates to using threading as part of the implementation of a servant (but not using POA threading policies). The IDL looks kind of like this:

module test {
       interface Worker {
               void ping ();
       };

       interface Master {
               void create_thread ();
               void submit_work (in Worker server);
       };
};

The Master servant in creates a new thread using glib in the create_thread() method. It the receives a reference to a Worker servant (in a different process) from the submit_work() method. The master then calls the ping() method on the Worker object. If the ping() is called in the same thread as the main loop, everythings works fine. However, if the ping() is called from the thread created in create_thread() the ORB drops out of its main loop and things fall apart. I've attached a log of ORBIT2_DEBUG=all. For the adventurous this is checked in to CVS under orbitcpp/test/cpp/threading. I was wondering if anyone had any insight into why the ORB is dropping out of its run loop or how I can find out why.

--
Bowie Owens

CSIRO Mathematical & Information Sciences
phone  : +61 3 9545 8055
fax    : +61 3 9545 8080
mobile : 0425 729 875
email  : Bowie Owens csiro au


** (process:19823): WARNING **: -- Forced orb into threaded mode --
Have safe dir '/tmp/orbit-owe043'Marshal object '0x806a4f8'
P-GIOP UNIX:/tmp/orbit-owe043/linc-4d6f-0-4d9aa5a5b4287:phi.vic.cmis.csiro.au
P-OS /tmp/orbit-owe043/linc-4d6f-0-4d9aa5a5b4287:0x0 '0000000086769450b785e8a8bd2c282828282828010000005229db3f'
P-<None>
IOR:010000001200000049444c3a746573742f4475616c3a312e30000000030000000054424f600000000101020005000000554e495800000000160000007068692e7669632e636d69732e637369726f2e61750000002c0000002f746d702f6f726269742d6f77653034332f6c696e632d346436662d302d346439616135613562343238370000000000caaedfba58000000010102002c0000002f746d702f6f726269742d6f77653034332f6c696e632d346436662d302d3464396161356135623432383700000000001c0000000000000086769450b785e8a8bd2c282828282828010000005229db3f01000000480000000100000002000000050000001c0000000000000086769450b785e8a8bd2c282828282828010000005229db3f01000000140000000100000001000105000000000901010000000000
Incoming IIOP header:
0x0000:   47 49 4f 50  01 02 01 00  6c 00 00 00  XX XX XX XX | GIOP....l...****
 --- 
Incoming IIOP body:
0x000c:   c0 d3 ff bf  03 00 00 00  00 00 00 00  1c 00 00 00 | ................
0x001c:   00 00 00 00  86 76 94 50  b7 85 e8 a8  bd 2c 28 28 | .....v.P.....,((
0x002c:   28 28 28 28  01 00 00 00  52 29 db 3f  07 00 00 00 | ((((....R).?....
0x003c:   5f 69 73 5f  61 00 4f 00  01 00 00 00  01 00 00 00 | _is_a.O.........
0x004c:   0c 00 00 00  01 01 01 01  01 00 01 05  09 01 01 00 | ................
0x005c:   00 00 00 00  14 00 00 00  49 44 4c 3a  74 65 73 74 | ........IDL:test
0x006c:   2f 4d 61 73  74 65 72 3a  31 2e 30 00  XX XX XX XX | /Master:1.0.****
 --- 
handling request
p 19823: handle request '_is_a'
p19823 1103585431.350655 : ([0x806a4f8])->_is_a ('IDL:test/Master:1.0') =>; 1Outgoing IIOP data:
0x0000:   47 49 4f 50  01 02 01 01  25 00 00 00  XX XX XX XX | GIOP....%...****
 --- 
0x000c:   c0 d3 ff bf  00 00 00 00  01 00 00 00  01 00 00 00 | ................
0x001c:   0c 00 00 00  01 01 01 01  01 00 01 05  09 01 01 00 | ................
0x002c:   00 54 42 4f  01 XX XX XX  XX XX XX XX  XX XX XX XX | .TBO.***********
 --- 
 1103585431.351031 
Incoming IIOP header:
0x0000:   47 49 4f 50  01 02 01 00  5c 00 00 00  XX XX XX XX | GIOP....\...****
 --- 
Incoming IIOP body:
0x000c:   70 d3 ff bf  03 00 00 00  00 00 00 00  1c 00 00 00 | p...............
0x001c:   00 00 00 00  86 76 94 50  b7 85 e8 a8  bd 2c 28 28 | .....v.P.....,((
0x002c:   28 28 28 28  01 00 00 00  52 29 db 3f  0e 00 00 00 | ((((....R).?....
0x003c:   63 72 65 61  74 65 5f 74  68 72 65 61  64 00 00 00 | create_thread...
0x004c:   01 00 00 00  01 00 00 00  0c 00 00 00  01 01 01 01 | ................
0x005c:   01 00 01 05  09 01 01 00  49 44 4c 3a  XX XX XX XX | ........IDL:****
 --- 
handling request
p 19823: handle request 'create_thread'
p19823 1103585431.352934 : ([0x806a4f8])->create_thread ()Outgoing IIOP data:
0x0000:   47 49 4f 50  01 02 01 01  24 00 00 00  XX XX XX XX | GIOP....$...****
 --- 
0x000c:   70 d3 ff bf  00 00 00 00  01 00 00 00  01 00 00 00 | p...............
0x001c:   0c 00 00 00  01 01 01 01  01 00 01 05  09 01 01 00 | ................
0x002c:   00 54 42 4f  XX XX XX XX  XX XX XX XX  XX XX XX XX | .TBO************
 --- 
 1103585431.405772 
Incoming IIOP header:
0x0000:   47 49 4f 50  01 02 01 00  88 01 00 00  XX XX XX XX | GIOP........****
 --- 
Incoming IIOP body:
0x000c:   60 d3 ff bf  03 00 00 00  00 00 00 00  1c 00 00 00 | `...............
0x001c:   00 00 00 00  86 76 94 50  b7 85 e8 a8  bd 2c 28 28 | .....v.P.....,((
0x002c:   28 28 28 28  01 00 00 00  52 29 db 3f  0c 00 00 00 | ((((....R).?....
0x003c:   73 75 62 6d  69 74 5f 77  6f 72 6b 00  01 00 00 00 | submit_work.....
0x004c:   01 00 00 00  0c 00 00 00  01 01 01 01  01 00 01 05 | ................
0x005c:   09 01 01 00  12 00 00 00  49 44 4c 3a  74 65 73 74 | ........IDL:test
0x006c:   2f 44 75 61  6c 3a 31 2e  30 00 30 00  03 00 00 00 | /Dual:1.0.0.....
0x007c:   00 54 42 4f  60 00 00 00  01 01 02 00  05 00 00 00 | .TBO`...........
0x008c:   55 4e 49 58  00 00 00 00  16 00 00 00  70 68 69 2e | UNIX........phi.
0x009c:   76 69 63 2e  63 6d 69 73  2e 63 73 69  72 6f 2e 61 | vic.cmis.csiro.a
0x00ac:   75 00 00 00  2b 00 00 00  2f 74 6d 70  2f 6f 72 62 | u...+.../tmp/orb
0x00bc:   69 74 2d 6f  77 65 30 34  33 2f 6c 69  6e 63 2d 34 | it-owe043/linc-4
0x00cc:   64 37 64 2d  30 2d 37 65  65 38 34 61  62 39 32 36 | d7d-0-7ee84ab926
0x00dc:   34 31 00 00  00 00 00 00  ca ae df ba  58 00 00 00 | 41..........X...
0x00ec:   01 01 02 00  2b 00 00 00  2f 74 6d 70  2f 6f 72 62 | ....+.../tmp/orb
0x00fc:   69 74 2d 6f  77 65 30 34  33 2f 6c 69  6e 63 2d 34 | it-owe043/linc-4
0x010c:   64 37 64 2d  30 2d 37 65  65 38 34 61  62 39 32 36 | d7d-0-7ee84ab926
0x011c:   34 31 00 00  00 00 00 00  1c 00 00 00  00 00 00 00 | 41..............
0x012c:   f5 90 58 c8  95 e5 28 28  bd 2c 28 28  28 28 28 28 | ..X...((.,((((((
0x013c:   01 00 00 00  5a ac 44 94  01 00 00 00  48 00 00 00 | ....Z.D.....H...
0x014c:   01 00 00 00  02 00 00 00  05 00 00 00  1c 00 00 00 | ................
0x015c:   00 00 00 00  f5 90 58 c8  95 e5 28 28  bd 2c 28 28 | ......X...((.,((
0x016c:   28 28 28 28  01 00 00 00  5a ac 44 94  01 00 00 00 | ((((....Z.D.....
0x017c:   14 00 00 00  01 00 00 00  01 00 01 05  00 00 00 00 | ................
0x018c:   09 01 01 00  00 00 00 00  XX XX XX XX  XX XX XX XX | ........********
 --- 
handling request
p 19823: handle request 'submit_work'
p19823 1103585431.408239 : ([0x806a4f8])->submit_work (Lookup 'IDL:test/Dual:1.0' (0x805a9d8) == (nil)
Profiles: P-GIOP UNIX:/tmp/orbit-owe043/linc-4d7d-0-7ee84ab92641:phi.vic.cmis.csiro.auP-OS /tmp/orbit-owe043/linc-4d7d-0-7ee84ab92641:0x0 '00000000f59058c895e52828bd2c282828282828010000005aac4494'P-<None>
[0x806d7d0])Request to submit work
Outgoing IIOP data:
0x0000:   47 49 4f 50  01 02 01 01  24 00 00 00  XX XX XX XX | GIOP....$...****
 --- 
0x000c:   60 d3 ff bf  00 00 00 00  01 00 00 00  01 00 00 00 | `...............
0x001c:   0c 00 00 00  01 01 01 01  01 00 01 05  09 01 01 00 | ................
0x002c:   00 54 42 4f  XX XX XX XX  XX XX XX XX  XX XX XX XX | .TBO************
 --- 
 1103585431.408883 
Thread picked up work
Initiated a connection to 'UNIX' 'phi.vic.cmis.csiro.au' '/tmp/orbit-owe043/linc-4d7d-0-7ee84ab92641'
Profiles match:
'IDL:test/Dual:1.0':P-GIOP UNIX:/tmp/orbit-owe043/linc-4d6f-0-4d9aa5a5b4287:phi.vic.cmis.csiro.au
'IDL:test/Dual:1.0':P-GIOP UNIX:/tmp/orbit-owe043/linc-4d6f-0-4d9aa5a5b4287:phi.vic.cmis.csiro.au
p19864 1103585431.520989 : ([0x806d7d0])->ping (Align = 12
Marshal: id 0xbf7ff96c
)Outgoing IIOP data:
0x0000:   47 49 4f 50  01 02 01 00  54 00 00 00  XX XX XX XX | GIOP....T...****
 --- 
0x000c:   6c f9 7f bf  03 00 00 00  00 00 00 00  1c 00 00 00 | l...............
0x001c:   00 00 00 00  f5 90 58 c8  95 e5 28 28  bd 2c 28 28 | ......X...((.,((
0x002c:   28 28 28 28  01 00 00 00  5a ac 44 94  05 00 00 00 | ((((....Z.D.....
0x003c:   70 69 6e 67  00 00 00 00  01 00 00 00  01 00 00 00 | ping............
0x004c:   0c 00 00 00  01 01 01 01  01 00 01 05  09 01 01 00 | ................
0x005c:   75 00 00 00  XX XX XX XX  XX XX XX XX  XX XX XX XX | u...************
 --- 
Incoming IIOP header:
0x0000:   47 49 4f 50  01 02 01 01  24 00 00 00  XX XX XX XX | GIOP....$...****
 --- 
Incoming IIOP body:
0x000c:   6c f9 7f bf  00 00 00 00  01 00 00 00  01 00 00 00 | l...............
0x001c:   0c 00 00 00  01 01 01 01  01 00 01 05  09 01 01 00 | ................
0x002c:   00 54 42 4f  XX XX XX XX  XX XX XX XX  XX XX XX XX | .TBO************
 --- 
handling reply
Clean demarshal on id 0xbf7ff96c

 1103585431.783073 
Thread finished work.
Incoming IIOP header:
0x0000:   47 49 4f 50  01 02 01 05  00 00 00 00  XX XX XX XX | GIOP........****
 --- 
received close connection

** (process:19823): WARNING **: CORBA_ORB_destroy: ORB still has 3 refs.

** (process:19823): WARNING **: ORB: a total of 6 refs to ORB objects were leaked
  2 refs to 'POA Manager'
  3 refs to 'ORB'
  2 refs to 'Adaptor'
exiting normally


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