W
Willy Denoyette [MVP]
Zytan said:This page http://www.thescripts.com/forum/thread229335.html says
"The stack is set to an arbitrarily small value when the program is
first loaded. The stack then grows on demand to meet the needs of the
thread. This is implemented by placing a page with PAGE_GUARD access
at the end of the current stack. When your code causes the stack
pointer to point to an address on this page, an exception occurs. The
system will commit your desired page. The 1M was the default maximum
stack size that can be commit."
So, it looks like it wouldn't make any difference, anyway.
Zytan
This article is based on the V1.X Framework and not quite correct.
In V2, you can create threads with other stack sizes than the 1MB default,
but the threads created before your program runs will still be 1MB max. Of
course you can edit the PE file header and set all stacks to a lower value
for the whole process, but that's in general a bad idea, CLR application
are quite stack "hungry".
Note that stack space is always pre-committed for CLR threads, this is *not*
the case for unmanaged threads which is what the above describes.
Willy.