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).

> OTOH I still don't know whether that would buy me much since I'd need an
> idle session (plugin not loaded) or hitting the (likely large) session timeout
> in order to reload the plugin by not having it loaded any more.
> Not to mention the "interesting" plugin/dlopen handling itself.
>

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)

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'.

Wim.

------------------------------------------------------------------------------
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