|  |  | 
  
    |  |  | 
 
  |   |  | 
  
    |  |  | 
  
    |  |  | 
  
    |   xen-cim
Re: [Xen-cim] Emailing: libxen.diff 
| FYI - CMPI already has a dedicated Cleanup()
method that invoked whenever the CIMOM is about to unload a provider lib
(and you can prevent unloading by returning a specific return code), and
the means to add an optional init() method that is invoked immediately
after a provider lib is first loaded and before the first request is processed.
Will using these avoid some of the issues here?
 
 - Gareth
 
 
 
 
 
| Ewan Mellor <ewan@xxxxxxxxxxxxx> Sent by: xen-cim-bounces@xxxxxxxxxxxxxxxxxxx
 12/24/2006 06:50 AM
 | 
| To | "Subrahmanian, Raj" <raj.subrahmanian@xxxxxxxxxx> |  
| cc | xen-cim@xxxxxxxxxxxxxxxxxxx, Jim Fehlig
<jfehlig@xxxxxxxxxx> |  
| Subject | 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
 
 
 _______________________________________________
Xen-cim mailing list
Xen-cim@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-cim
 | 
 |  | 
  
    |  |  |