asp tutorials, asp.net tutorials, sample code, and Microsoft news from 15Seconds
Data Access  |   Troubleshooting  |   Security  |   Performance  |   ADSI  |   Upload  |   Email  |   Control Building  |   Component Building  |   Forms  |   XML  |   Web Services  |   ASP.NET  |   .NET Features  |   .NET 2.0  |   App Development  |   App Architecture  |   IIS  |   Wireless
 
Pioneering Active Server
 Power Search










Active News
15 Seconds Weekly Newsletter
• Complete Coverage
• Site Updates
• Upcoming Features

More Free Newsletters
Reference
News
Articles
Code Samples
Components
Tools
FAQ
Feedback
Books
Links
DL Archives
Community
Messageboard
List Servers
Mailing List
WebHosts
Consultants
Tech Jobs
15 Seconds
Home
Site Map
Press
Legal
Privacy Policy
internet.commerce














internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

HardwareCentral
Compare products, prices, and stores at Hardware Central!

PreviousNext

 

email this FAQ to a colleague

Q: Should I not use Thread Local Storage (TLS) in an ISAPI App?

A: In some situations (depending on where and how you allocate thread local storage) this is true. However, because under Win NT, every DLL is guaranteed to have DllMain called with a "thread detach" reason code (under normal process termination), using TLS is safe as long as you are sure to deallocate everything in response to this reason code. In the event of abnormal process termination, a lot more will be leaked anyway.

What John was trying to say is that you never know on what thread you might be called (inside an ISAPI DLL), so using TLS for anything other than tracking resources that are explicitly bound to a particular thread is a bad idea. In the case of OLE, all calls are bound explicitly to the specific thread you are called on or calling from (in the apartment threading model), so using TLS is actually the best way to monitor your initialization state.

You can reference the OLEISAPI example as a reference (TLS is used there to flag whether OLE has been initialized for the current thread or not).

- Travis James

Articles
Jul 20, 1997 - Running ISAPI applications Within IIS 4.0
This issue discusses and demonstrates how to run isolated ISAPI applications. Included are considerations for moving your ISAPI application from IIS 3.0 to IIS 4.0, performance considerations and the effects of isolated ISAPI applications on ODBC connection pooling.
[Read This Article]  [Top]

Books
Active X Programming Unleashed
Weiying Chen
Teach yourself ActiveX Programming in 21 days
Sanders, Jr Kaufman, Jeff Perkins, Dina Fleet, Sanders Kaufman Jr.
Using ISAPI
Stephen Genusa, Bobby, Jr Addison, Allen Clark, Dean Cleaver
Inside ISAPI
Kevin Clements, Chris Wuestefeld, Jeffrey Trent

Related Topics
ISAPI


Support the Active Server Industry



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers