Re: Thread Stacks



On Tue, 29 Nov 2005 10:40:24 -0500 in comp.arch, "Eric P."
<eric_pattison@xxxxxxxxxxxxxxxxxx> wrote:

[...]
>I conclude therefore that the correct solution is to specify the
>reserved linear stack size for each individual thread at create
>and that means it is as an argument to the ThreadCreate function.
>Note that this is NOT how Win32 works. As an optimization one could

What, then, is the purpose of the dwStackSize parameter to the Win32
function CreateThread?

>maintain a pool of previously used stack ranges to save continuously
>reserving and releasing the same sized memory sections.
>
>As the stack grows down, each thread should track its low water mark,
>and bounds check and commit new space efficiently, as a single system
>request, only when below the mark. This is also not how Win32 works.

Windoze commits only a page at a time (by default) to a thread's stack
as each page boundary is exceeded. How is this different from what
you describe?

I'm not saying you are wrong. I'm trying to understand how your
solution differs from Win32.

Regards,
-=Dave

--
Change is inevitable, progress is not.
.



Relevant Pages

  • Re: Who could tell me why the error address isnt the same?
    ... I use vc6.0,and when I set active project configuration to Win32 Debug,and ... What actually happened is that the strcpy was writing outside of the memory occupied by, into the rest of the stack. ... The difference between Debug and Release is that Debug build puts some extra data on the stack to help you debug easily. ...
    (microsoft.public.vc.mfc)
  • Re: Why no language improvements?
    ... its not in the win32 compiler. ... the /Win32/ compiler doesn't have stack based objects, ... +AD4- You dont know what a copy constructor is yet you feel compelled to ...
    (borland.public.delphi.non-technical)
  • Re: Crash-Diagnose
    ... eigentlich reproduzieren sollte, weil die Anweisungen 1:1 so durchlaufen werden, wie es in der Anwendung selbst ablief, als es Probleme gemacht hat. ... // change the stack only if the selectors are the same (this is the case for Win32) ...
    (microsoft.public.de.vc)
  • Re: Who could tell me why the error address isnt the same?
    ... the stack is completely different. ... When a program is compiled in debug mode, it uses the debug heap, the debug libraries, and ... learn this is to study the output from compilers). ... I use vc6.0,and when I set active project configuration to Win32 Debug,and ...
    (microsoft.public.vc.mfc)
  • Re: How to recover from a EXCEPTION_STACK_OVERFLOW?
    ... // change the stack only if the selectors are the same (this is the case for Win32) ... I guess I can no longer use pExPtrs after modifying esp, nor any local variable even if declared after the change? ... But you should not use any local variables, because this increases the stack! ...
    (microsoft.public.win32.programmer.kernel)

Loading