Re: To get the stacksize of current Thread?



For what purpose?

Some years ago, we had a LISP interpreter built into our system (XLISP). The problem was
if the user wrote a recursive loop, we wanted to catch the stack overflow and report it,
but not crash the program. I had to create a special version of the stack-probe
subroutine that we linked into our version; it automatically subtracted 1K off the stack
size and reported a stack overflow 1K bytes early, but it reported it by doing a longjmp
(providing the pointer to the longjmp block was not NULL). In C++, I'd throw an
exception. So we used #pragmas to ensure that every module in the LISP interpreter that
could be involved in a recursion had stack probes enabled, even in release mode. Took me
several days to get this all working right, and another week to tune the performance so we
weren't doing stack probes in time-critical but stack-cheap functions.
joe

On Wed, 21 May 2008 16:52:36 +0530, "Sha" <shahulalways@xxxxxxxxxxx> wrote:

Hi pals,

How can I get the stacksize of a particular thread.


Regards,
Sha

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: What cause " stack overflow " ?
    ... The code below does not seem to cause a stack ... This does not mean that it is CTrackPanel that caused the fault. ... sometimes it report " not enough memory", ... log creations of CTrackPanel and log the stack value along with it ...
    (microsoft.public.vc.language)
  • gdb and dbx question
    ... Both dbx and gdb seems to report incorrect stack ... In dbx report, one function takes NULL as arg, which according ...
    (comp.lang.c)
  • Re: Peavey Windsor half stack the sequel
    ... For 400 smackers for a half stack? ... I'll report back ... A mini-half stack for $400 with a lot of good reviews. ... interested in finding out so I left him to his own limited devices but did ...
    (alt.guitar)
  • Re: System.NullReferenceException: Object reference not set to an
    ... the stack shows error during compiling and assembly ... It happen so many times that every time it happen, all the aspx pages get ... affected and the .net service return the same error for every aspx pages. ... >> will be receiving a daily report that should be beneficial in planning ...
    (microsoft.public.dotnet.framework.aspnet)