Bug when attaching data to thread

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using thread.GetNamedDataSlot and thread.SetData to attach data to a
thread inside of a class library which in turn is used by an asp.net 2.0
application. For the most part it works but we are getting sporadic problems
where the data that was just set on the thread cannot be retrieved (it's
null).

It's almost like the IIS thread that we attach the data to at the beginning
of the call is lost and a new thread created before the call finishes. But I
don't believe this is how the IIS works on windows 2003. The thread that
starts should be the one that finishes the call and thus should have the data
in the slot throughout the life of the thread.

Has anyone ever experienced this kind of problem?
 
Async pages in ASP.NET 2.0, for one, can make the request processing
jump around on different threads. It would be safer to use the Items
collection on HttpContext - ASP.NET will keep the logical context of a
request in tact.
 
Hi Mike,

I am experiencing this problem too when the system is under load. The
content in the thread is lost sporadically and it happens in about 1 in
250 page hits. Very strange. Have you managed to find a resolution? I'm
using Windows 2003 too but on asp.net 1.1.

Regards,
Laurence
 
Back
Top