Home All Groups Group Topic Archive Search About

ISAPI extension change .Net default stack size

Author
8 Nov 2005 9:00 PM
Frank Postle
Okay this is ugly, but here it goes.

We have an unmanaged IIS ISAP extension.  We use the worker thread approach
and spin up our own threads creating the stack size that we want.

Later in our code we have a C# module that get's executed and we begin
executing managed code here.  Inside of the managed code we we start a thread
using the below approach (for timeout).  The problem is that there are certin
cases where the new thread we created is running out of stack.

Sure if we had an exe we could use editbin to increase the default size of
the stack.  But I don't think this works for dll's.

Is there anything we can do to change the default size of the stack that
will be created in the C# module?  It is important to note that the C# module
at the end of the day executes some other unmanaged C++ code.  There is no
recursion to eliminate there is just a very structured and complicated
application (in both good and bad ways but we really can't change too much
here).

Our other thought is to rewrite C# module in good old unmanaged C++ so that
we can make calls that allow use to create threads of arbitrary size.

Regards

Frank

// ScriptThread is our class that does the work
ScriptThread st = new  ScriptThread(method,null,Thread.CurrentThread,"",null);
ThreadStart threadDelegate = new ThreadStart(st.Run);
Thread newThread = new Thread(threadDelegate);
newThread.Start();
newThread.Join(_nTimeoutSeconds *1000);
newThread.Abort();

AddThis Social Bookmark Button