tag:blogger.com,1999:blog-11388923.post4781597191872737184..comments2024-03-24T20:54:16.021-05:00Comments on Bart's Blog: .NET thread local storage implementation kicks my buttAnonymoushttp://www.blogger.com/profile/01154315948247678050noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-11388923.post-29838937162850832832009-09-10T21:12:32.393-05:002009-09-10T21:12:32.393-05:00It's funny, I've gotten away with not usin...It's funny, I've gotten away with not using [ThreadStatic] or similar concepts all this time - not quite sure how though. I can see how it'd be useful, though it would seem to me that using Thread Local Storage would cause problems with testing in isolation. <br /><br />At work our system relies on TLS to store information about the request and retrieve it later for logging, but that approach always seemed a little bit too "magical" for my taste. I like to structure my code so in each method, it's obvious what you have access to (usually just the parameters). When TLS is used, the code may have to rely on the presence of a TLS value that was set by somewhere completely different in the code.<br /><br />Unless TLS is used for caching of course, then it seems like a good use of it to me :)Unknownhttps://www.blogger.com/profile/07844615691065246240noreply@blogger.com