|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|