You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Nick Kew <ni...@apache.org> on 2013/04/05 12:13:52 UTC

Loading dynamic libraries

Igor pinged me a couple of days ago about libloader, the tiny
plugin that serves to load libraries (in the manner of LoadFile
in HTTPD).  He also tweeted Qualys.

Since then I've exchanged email with Brian, and he's happy to
donate it.  If folks are happy with it, I'll deal with the administrivia
and commit to trafficserver repos.

Questions for discussion: should it be integrated into the build,
or left for those who want it to DIY?  If it's to go in the build it'll
also need to go in the docs, but I guess it's not critical if it
doesn't all happen at once.

If noone speaks up I'll take lazy consensus as start with the
code then add build and docs as time permit.

Original need for this plugin:
http://mail-archives.apache.org/mod_mbox/trafficserver-dev/201109.mbox/%3C20110923150522.5432c1be@baldur%3E

Contribution to TS previously mooted at
http://mail-archives.apache.org/mod_mbox/trafficserver-dev/201112.mbox/%3C974f0e63-35f5-466d-8fc4-5b0482177baa@iris%3E


-- 
Nick Kew

Re: Loading dynamic libraries

Posted by James Peach <jp...@apache.org>.
On Apr 5, 2013, at 12:24 PM, Nick Kew <ni...@apache.org> wrote:

> 
> On 5 Apr 2013, at 18:53, James Peach wrote:
> 
>> Ah. It seems dangerous to me; some other plugin could register a subsequent atexit() that depends on the DSOs that you are tearing down.
> 
> To depend on a library, would it not have to take place after the library is loaded?
> In which case, its atexit would also run first, while the library was still loaded.

Hmm ... yes, you are right :)

J

Re: Loading dynamic libraries

Posted by Nick Kew <ni...@apache.org>.
On 5 Apr 2013, at 18:53, James Peach wrote:

> Ah. It seems dangerous to me; some other plugin could register a subsequent atexit() that depends on the DSOs that you are tearing down.

To depend on a library, would it not have to take place after the library is loaded?
In which case, its atexit would also run first, while the library was still loaded.

-- 
Nick Kew

Re: Loading dynamic libraries

Posted by James Peach <jp...@apache.org>.
On Apr 5, 2013, at 10:24 AM, Nick Kew <ni...@apache.org> wrote:

> On Fri, 05 Apr 2013 09:10:47 -0700
> James Peach <jp...@apache.org> wrote:
> 
>> BTW, why does it bother trying to unload the libraries?
> 
> A sense of tidiness and order?

Ah. It seems dangerous to me; some other plugin could register a subsequent atexit() that depends on the DSOs that you are tearing down.

J

Re: Loading dynamic libraries

Posted by Nick Kew <ni...@apache.org>.
On Fri, 05 Apr 2013 09:10:47 -0700
James Peach <jp...@apache.org> wrote:

> BTW, why does it bother trying to unload the libraries?

A sense of tidiness and order?

There's precious little in my life, but it's Good Practice
in software, IMHO.

-- 
Nick Kew

Re: Loading dynamic libraries

Posted by James Peach <jp...@apache.org>.
On Apr 5, 2013, at 3:13 AM, Nick Kew <ni...@apache.org> wrote:

> Igor pinged me a couple of days ago about libloader, the tiny
> plugin that serves to load libraries (in the manner of LoadFile
> in HTTPD).  He also tweeted Qualys.
> 
> Since then I've exchanged email with Brian, and he's happy to
> donate it.  If folks are happy with it, I'll deal with the administrivia
> and commit to trafficserver repos.

Great!

> Questions for discussion: should it be integrated into the build,
> or left for those who want it to DIY?  If it's to go in the build it'll
> also need to go in the docs, but I guess it's not critical if it
> doesn't all happen at once.

I'd prefer it to be integrated into the build. Its simple enough plugin that I'm happy for it to go straight in to the stable area rather than experimental.

BTW, why does it bother trying to unload the libraries?

> If noone speaks up I'll take lazy consensus as start with the
> code then add build and docs as time permit.
> 
> Original need for this plugin:
> http://mail-archives.apache.org/mod_mbox/trafficserver-dev/201109.mbox/%3C20110923150522.5432c1be@baldur%3E
> 
> Contribution to TS previously mooted at
> http://mail-archives.apache.org/mod_mbox/trafficserver-dev/201112.mbox/%3C974f0e63-35f5-466d-8fc4-5b0482177baa@iris%3E
> 
> 
> -- 
> Nick Kew