httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Robb <sr...@wisewire.com>
Subject RE: mod_isapi
Date Tue, 22 Jul 1997 14:58:30 GMT
>On Mon, 21 Jul 1997, Alexei Kosut wrote:
>
>> aren't in use anymore, and so I couldn't figure out how to make it
unload
>> the DLL at a good time.
>
>Oh I understand your dilemna.  LoadLibrary()s are not reference counted
>probably.  So a single unload would unload it even if other threads
were
>using it.  You'd have to implement your own reference counting then to
do
>a cleanup.
>
>Dean

LoadLibrary()/FreeLibrary() do keep a reference count for
modules, so you should be OK calling LoadLibrary()/FreeLibrary()
around calls to the ISAPI extension dll.  If there are multiple
thread using the DLL, then it won't unload until FreeLibrary()
reduces the reference count to 0.

You might want to think about calling GetModuleHandle() before
LoadLibrary(). If the DLL isn't loaded, then you'll get back a
NULL module handle, and you can call LoadLibrary() an additional
time to essentially lock the DLL in memory.  I think that IIS
does this, with a periodic sweep through a list of loaded extension
DLLs to call FreeLibrary() and unload ones that haven't been
accessed recently.

- Samrobb (srobb@empirical.com)
- WiseWire Corporation - "Delivering personalized intelligence"
- http://www.wisewire.com

The box said 'Requires Windows 95, or better.' So I bought a Macintosh.



> -----Original Message-----
> From:	Dean Gaudet [SMTP:dgaudet@arctic.org]
> Sent:	Tuesday, July 22, 1997 2:06 AM
> To:	Apache
> Subject:	Re: mod_isapi
> 
> 
> 
> On Mon, 21 Jul 1997, Alexei Kosut wrote:
> 
> > aren't in use anymore, and so I couldn't figure out how to make it
> unload
> > the DLL at a good time.
> 
> Oh I understand your dilemna.  LoadLibrary()s are not reference
> counted
> probably.  So a single unload would unload it even if other threads
> were
> using it.  You'd have to implement your own reference counting then to
> do
> a cleanup.
> 
> Dean

Mime
View raw message