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
Jan 4, 2001 - JavaScript Protection With An ISAPI Filter
This article by Itay Weinberger describes how to use an ISAPI filter to prevent unauthorized access to your JavaScript or VBScript files.
[Read This Article]  [Top]

Books
Using ISAPI
Stephen Genusa, Bobby, Jr Addison, Allen Clark, Dean Cleaver
Inside ISAPI
Kevin Clements, Chris Wuestefeld, Jeffrey Trent

Related Topics
ISAPI Extensions

Knowledge Base Articles
INFO: Tips for Debugging ISAPI DLLs
Q152054 - 1997.09.07
PRB: Required Privilege is Not Held ISAPI Debug...
Q163351 - 1997.09.07
BUG: MFC ISAPI Generates Access Violation in CH...
Q167736 - 1998.05.08
Profile an ISAPI DLL
Q195768 - 1998.12.02
FILE: Creating a Thread Pool for MFC-Based ISAP...
Q197728 - 1998.12.31


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