Thread.Thread(ThreadStart, Int32) Constructor
Assembly: mscorlib (in mscorlib.dll)
A ThreadStart delegate that represents the methods to be invoked when this thread begins executing.
The maximum stack size to be used by the thread, or 0 to use the default maximum stack size specified in the header for the executable.
Avoid using this constructor overload. The default stack size used by the Thread(ThreadStart) constructor overload is the recommended stack size for threads. If a thread has memory problems, the most likely cause is programming error, such as infinite recursion.
If maxStackSize is less than the minimum stack size, the minimum stack size is used. If maxStackSize is not a multiple of the page size, it is rounded to the next larger multiple of the page size. For example, if you are using the .NET Framework version 2.0 on Microsoft Windows Vista, 256KB (262144 bytes) is the minimum stack size, and the page size is 64KB (65536 bytes).
On versions of Microsoft Windows prior to Windows XP and Windows Server 2003, maxStackSize is ignored, and the stack size specified in the executable header is used.
If you specify a very small stack size, you might need to disable stack-overflow probing. When the stack is severely constrained, the probing can itself cause a stack overflow. To disable stack overflow probing, add the following to your application configuration file.
<configuration> <runtime> <disableStackOverflowProbing enabled="true"/> </runtime> </configuration>
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter EditionThe Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.