一个进程有一个堆栈还是一个线程一个堆栈还是一个函数一个堆栈?
解决方案 »
- MFC基于dialog的程序,dialog类里控件绑定的变量和自定义类的变量成员如何对应起来。
- 请教使用 zlib库 编译提示 unresolved external symbol _compress 的问题
- *************如何才能让女朋友HuaiYun呢,大家给支个招****************
- 各位大侠:哪位有对类似超市条形码扫描机器进行操作的代码?
- 关于ParseDisplayName的问题
- 工具条上的提示文字怎么实现?
- 郁闷!程序为什么不能设置断点?
- 如何取得一个区域内某点的像素值?
- 求正则表达式
- Unix下编写的CGI仍能实现动态菜单等控件的消息响应,并触发相关处理函数吗???
- 调用什么函数执行一个程序?比如 .exe文件?
- 异常发出何种消息?
如果我记得不错的话
一个process有一个堆,一个堆中有N个栈
一个thread有一个栈
Each new thread receives its own stack space, consisting of both committed and reserved memory. The system will commit one page blocks from the reserved stack memory as needed, until the stack cannot grow any farther.
The default size for committed and reserved memory is specified in the executable file header. The default reserved memory is one megabyte. To specify a different default stack size, use the STACKSIZE statement in the module definition (.DEF) file. Your linker may also support a command-line option for setting the stack size. For more information, see the documentation included with your linker.Threads that call the C run-time library or the Windows API must allow sufficient stack space for use of these functions. Do not lower the reserved stack size below 64 KB.To increase the amount of stack space which is to be initially committed for a thread, specify the value in the dwStackSize parameter of the CreateThread or CreateRemoteThread function. This value is rounded to the nearest page. The call to create the thread fails if there is not enough memory to commit or reserve the number of bytes requested. If dwStackSize is smaller than the default reserve size, the new thread uses the default reserve size. If dwStackSize is larger than the default reserve size, the reserve size is rounded up to the nearest multiple of 1 MB.
Windows Server 2003 and Windows XP: If the dwCreationFlags parameter of CreateThread or CreateRemoteThread is STACK_SIZE_PARAM_IS_A_RESERVATION, the dwStackSize parameter specifies the amount of stack space which is to be initially reserved for the thread.
The stack is freed when the thread terminates.
DWORD flOptions, // heap allocation flag
DWORD dwInitialSize, // initial heap size
DWORD dwMaximumSize // maximum heap size
);
一个进程可以通过它创建私有堆。。一个进程可以有多个堆。