It's very frustrating when a server component fails and gives you no information about why. Especially when the asp.net code that fails on the server works just fine on the visual studio 2010 development server.
In this case, I had a function that called itself recursively. It scanned and table and generated another table looking for the least cost of all possible combinations of the first table.
It turns out that IIS is really conservative about stack space it allocates to a thread, but then doesn't tell you if you exceed that (which is really each with a recursive function) - it just doesn't return anything. A useless entry is recorded in the event log.
Anyway, the solution is to run your recursive function in it's own thread using threading.thread
In the NEW method, you have an optional parameter, stacksize, and you can set it to whatever you want. In my case, I upped it to 5Mb for the function, and hey presto, it all works properly.
Tuesday, 22 February 2011
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment