From: "Nick Kew"
> > Hello everyone. > > I have Apache 2 module running under Windows.In each Apache's > thread I have a separate ODBC connection to a database. > > Why every thread? Wouldn't it be more efficient to share a connection > pool between your threads? You might possibly want to look at mod_pg_pool > (at http://apache.webthing.com/ ) as a template for that. > Or the many other ways! > > My questions are : > > Can't answer them. > > ICBW, but AIUI threads in your MPM are merely an implementation of > Apache's abstract architecture, so if you tie something to them, > you're more-or-less fighting against the architecture. That means > your module is likely to be non-portable and at risk of breaking on > future Apache updates. > Really define MPM? <quote> "...the purpose of MPMs is to improve performance on specific platforms." </quote> Ryan Bloom the "creator" of Apache2! > 1) What could be a reason for one > Apache thread to be terminated The thread did what it was suppose to and returned or timed out or ???? > 2) How can I be notified when a thread > is destroyed so I can close the DB connection Forgetting the database "issues" here is how thread tracking on Windows can be done. You can do all this in any computer language but for all to follow along, in Windows Scripting: Windows Scripting with VBScript scripts. Adjust the scripts to your needs, then save the VBScript script file to any folder. Then in a command prompt window set to the VBScript script's folder, use the Windows Script Host (WSH) engine cscript.exe by typing: cscript.exe VBScriptFileName.vbs Remember one can also use the script language of your desire with the Windows Script Host (WSH) engines. Monitoring Threads http://www.microsoft.com/technet/scriptcenter/scrguide/sas_prc_kfqh.asp MSDN - The WMI Win32_Thread Class http://msdn.microsoft.com/library/en-us/wmisdk/wmi/win32_thread.asp MSDN - The WMI Win32_Process Class http://msdn.microsoft.com/library/en-us/wmisdk/wmi/win32_process.asp The TechNet Script Center http://www.microsoft.com/technet/scriptcenter An ONLINE version of the 1328 page Scripting Guide: Microsoft Windows 2000 Scripting Guide http://www.microsoft.com/technet/scriptcenter/scrguide/sagsas_overview.asp Jeff