Boost logo

Boost :

Subject: Re: [boost] Checking interest in DynamicLoad/DLL/DSO/Plugin library
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2014-09-02 05:49:53


On 2 Sep 2014 at 11:14, Antony Polukhin wrote:

> > 1) Notification of shared library unloading and loading.
>
> Well, in DLL/DSO you can track loads unloads using some global variables:

I think he meant that he wants the ability to hook into the
load/unload of some arbitrary DLL/DSO, so like a DLL/DSO local
atexit() as it were.

This is trivial to implement, simply a static object defined per
DLL/DSO which accepts a list of bound functions to call when it gets
destructed.

Something kinda cool would be combining that hook with the
pointer-to-DLL/DSO code I sent you, so you could have code like:

// Tell me when the DLL/DSO owning this string gets unloaded so I can
// delete my use of it
dll_from_ptr(str)->on_unload(std::bind(this, &remove_string, str));

Niall

-- 
ned Productions Limited Consulting
http://www.nedproductions.biz/ 
http://ie.linkedin.com/in/nialldouglas/



Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk