What is the difference between reserve argument and commit argument to CreateThread
Windows API function?
I can't understand the following lines ..
The reserve argument sets the amount of address space the system should reserve for the thread's stack. The default is 1 MB. The commit argument specifies the amount of physical storage that should be initially committed to the stack's reserved region.
these two lines you will find them in this paragraph which explains one of the parameters of the CreateThread
function in c++
cbStackSize
The
cbStackSize
parameter specifies how much address space the thread can use for its own stack. Every thread owns its own stack. WhenCreateProcess
starts a process, it internally callsCreateThread
to initialize the process' primary thread. For thecbStackSize
parameter,CreateProcess
uses a value stored inside the executable file. You can control this value using the linker's/STACK
switch:
/STACK:[ reserve][, commit]
The reserveargument sets the amount of address space the system should reserve for the thread's stack. The default is 1 MB. The commitargument specifies the amount of physical storage that should be initially committed to the stack's reserved region.