On Thu, Feb 11, 2010 at 11:38:58AM +0100, Wim Dumon wrote:
> 2010/2/11 Andreas Mohr <[email protected]>:
> >
> > Forget what I said: the "missing" destroyApplication function is not a 
> > problem
> > at all as long as there's proper object encapsulation as it should be.
> >
> > Web session will run into timeout, witty server will destroy session
> > (it will, right? OTOH not doing so would be a _very_ visible memory leak ;),
> > thus WApplication object will get deleted together with its _internally_ 
> > managed
> > runtime library handling which at this point is able to close the library.
> >
> 
> Web sessions will indeed time out after a while. At every request, the
> session list is examined for expired sessions and timed out sessions
> are destroyed. There's a small catch currently where the last session
> doesn't time out if the webserver hasn't any activity at all, but that
> is a separate issue that we can quite easily fix (we shouldn't check
> for idles on every request, but rather based on a timer).

I just thought that the timer might have a problematic border case (DoS),
but it seems that isn't the case (it doesn't seem to aggravate anything
that wasn't broken before anyway).

> Like OvermindDL1 suggests, you can probably handle this in 
> createApplication():
> 
> WApplication *createApplication(...)
> {
>   dll = openDll();
>   dllCreateApplication = dllGetFunctionPointer(dll, "createApplication");
>   return dllCreateApplication(...);
> }
> 
> There's probably some experimentation to do on what Linux (or other
> unices) does when you overwrite a .so, if you can (want to?) open a
> .so multiple times (you could do some reference counting), and if the
> destructor of a WApplication is indeed a good spot to unload the .so
> (you are kind of cutting the grass from under your feet, as the code
> that unloads the .so is in the .so itself. sounds like a suicide
> mission to me)

AFAIK on Linux library upgrades will transparently use the newer version
for newly loaded apps, with old apps continuing to use the old version
(and very often shared between _ALL_ loaded apps,
due to PIC - position-independent code - as opposed to relocation-requiring
Windows DLL mechanisms).

Not necessarily suicide mission. You could have the WApplication dtor
call into an external function which thus wouldn't get unloaded.
Hrmm OTOH the dtor would then still need to finish, thus upon return of that
callback it could possibly bomb anyway.

> Anyway, it is an interesting idea if this could reduce the test cycle
> to 'compile and hit reload', whereas it is currently 'compile, restart
> webserver, hit reload'.

Indeed.

Andreas Mohr

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to