From: vruz Date: 2005-03-18T04:22:23+09:00 Subject: Re: Maximum stack depth On Fri, 18 Mar 2005 04:11:18 +0900, Paul Hanchett wrote: > (Showing my ignorance:) I thought windows apps had an automatically > expanding stack. Stealing from: http://www.cswl.com/whiteppr/white/multithreading.html ............ The Birth of a Thread: CreateThread An inevitable part of a thread is some code to execute. Under Windows NT, the address of a function is passed as a parameter to CreateThread to execute in the thread. The thread executes as long as it does not return from it. The thread can be terminated using TerminateThread. Each thread runs on a separate stack. To be more precise, each thread runs on either of two dedicated stacks—the kernel stack or the application stack—depending on whether system or application code executes in it, respectively, but the kernel stack is nothing that is ever visible in any form. Windows NT will dynamically grow the stack if necessary, but it will never grow it past 1 MB. This is to prevent infinitely recursive function calls from blowing up your process. ...........