Re: How to add idle task to ORBit2 server ?



On Sun, Aug 21, 2005 at 03:38:57PM +0800, KC wrote:
> Hi,
>

Hi KC,

> How can I add an idle task to ORBit2 server?
> I have a IDL method which allow client to malloc()
> a memory space on server side.   And I want to
> have an idle task to check if the memory is still
> in used ... if not, then the idle task will free the
> memory space.  Thanks.
> 

I think we have some code that maybe can help you, we use the glib thread
library as usual, you can browse it on this URL:

http://bonsai.fisterra.org/cgi-bin/bonsai/cvsblame.cgi?file=fisterra-bmodules/auth/src/server/fisterra_session_server.c&rev=&root=/var/publiccvs

It starts a background thread that manages the corba objects, sessions in
this case, and free them if they are not used anymore. You can find the
startup of the thread on the line 209, and the definition of that method on
the line 77. The implementation of the actual method is in this file (line
219):

http://bonsai.fisterra.org/cgi-bin/bonsai/cvsblame.cgi?file=fisterra-bmodules/auth/src/server/com/f_com_auth_services.c&rev=&root=/var/publiccvs

I think the most important is adding a critical section in order to handle
the threads shared variable.

Regards.

-- 

Alejandro Garcia Castro
mailto: acastro igalia com
http://www.igalia.com


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