Re: More multi-threading questions...



Hi Justin,

On Tue, 2003-09-09 at 08:39, Justin Schoeman wrote:
> Sorry, my mistake, I meant the server main loop.  At the moment I exit 
> the main loop by calling CORBA_ORB_shutdown from a signal handler. 

	Ah ! - in which case yes; just run the glib mainloop instead of your
custom one so:

	CORBA_ORB_init ();

	loop = g_main_loop_new(g_main_context_default(), TRUE);
	g_main_loop_run (loop);

	CORBA_ORB_destroy ();

<signal handler>
	g_main_loop_quit (loop);

> Unfortunately, this means that I can no longer use the CORBA client to 
> unregister from the name service (unless I re-initialise CORBA, which I 
> suppose is an option).  Is there another way to terminate the CORBA 
> server main loop (without terminating the ORB).

	As above; we hook into the default glib main context.

> This is for a 'universal' vending platform.  Some stock types can take a 
> while for purchases to complete, so the purchases need to take place in 
> separate threads...

	Sounds interesting.

> PS: Bonus marks to anybody who can find the memory leak in the test app! 
>   It seems to leak about 4 bytes for every object instantiate/destroy 
> cycle (in single or multi-threaded mode).

	Really ? that's pretty bad; prolly your servant I'd guess. 

	Regards,

		Michael.

-- 
 michael@ximian.com  <><, Pseudo Engineer, itinerant idiot




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