WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-cim

Re: [Xen-cim] Emailing: libxen.diff

On Sun, Dec 24, 2006 at 02:20:50AM -0500, Subrahmanian, Raj wrote:

> Ewan,
> It looks like if we can just do these inside _init and _fini (which are
> functions called when the library is loaded and unloaded respectively),
> we won't need to wory about MT-safeness. The OS won't unload the shared
> library till everyone who's linked to it has unloaded.
> Was there any specific reason why there were specific xen_init and
> xen_fini calls created?

Well firstly, _init and _fini are marked OBSOLETE/DANGEROUS on pages
like this:

http://tldp.org/HOWTO/Program-Library-HOWTO/miscellaneous.html

Secondly, they only apply to shared libraries -- if libxen were linked
statically with your application, this facility would not be available.

Having xen_init and xen_fini gives you the most flexibility -- if you
know that you're in a threaded environment, or are loading as a dynamic
module, then you can wrap them up appropriately, and if you're running
in a statically compiled program, then you can just call them at the top
and bottom of main().

For your particular problem, I think you just need to push the mutex up
into the CIM provider rather than libxen, and everything should be fine.

Ewan.

_______________________________________________
Xen-cim mailing list
Xen-cim@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-cim

<Prev in Thread] Current Thread [Next in Thread>