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

To: Ewan Mellor <ewan@xxxxxxxxxxxxx>, "Subrahmanian, Raj" <raj.subrahmanian@xxxxxxxxxx>
Subject: Re: [Xen-cim] Emailing: libxen.diff
From: Gareth S Bestor <bestorga@xxxxxxxxxx>
Date: Sun, 24 Dec 2006 16:47:21 -0500
Cc: Jim Fehlig <jfehlig@xxxxxxxxxx>, xen-cim@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sun, 24 Dec 2006 13:47:12 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20061224115032.GA15090@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-cim-request@lists.xensource.com?subject=help>
List-id: xen-cim mailing list <xen-cim.lists.xensource.com>
List-post: <mailto:xen-cim@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-cim>, <mailto:xen-cim-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-cim>, <mailto:xen-cim-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-cim-bounces@xxxxxxxxxxxxxxxxxxx

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
<Prev in Thread] Current Thread [Next in Thread>