Strange multithreaded problem on IIS 7
The website has a .dll in its bin folder that has one method that is multithreaded. Its a fairly fast process, (half a second) so timeout is not an issue.
On our development IIS 7, this runs without a hitch. Same on all the programmers machines. However, on the production IIS7, it f开发者_如何学编程ails to launch the parameterized thread here are the code line:
ParameterizedThreadStart start = new ParameterizedThreadStart(queryDb);
Thread thrd = new Thread(start);
thrd.Start(ndb);
Its pretty standard stuff. My question is, does anybody know of anything in IIS7 that would keep it from spawning a thread, like above
Potetnial reason: If you haven't correctly shutdown older threads and have 32 bit machine you soon will run out of address space to allocate stack for new threads.
Note: consider using thread pool (i.e. QueueWorkItem http://msdn.microsoft.com/en-us/library/kbf0f1ct.aspx) to perform one off tasks. Or consider using asnchronous pages if processing is actually part of the page rendereing (instead of waiting for thread completition).
Another potential reason: the code requires full trust, which you have on your local testing, but not at the server. Do you use any security critical or unsafe code?
精彩评论