🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.os2.programmer.misc
2 messages
2 total messages Started by Keith Bennett Thu, 29 Sep 1994 22:11
Tool to determine stack usage?
#203
Author: Keith Bennett
Date: Thu, 29 Sep 1994 22:11
17 lines
1473 bytes
I make an educated guess when determining the stack size for a new
thread.  Does anyone have any suggestion as to a more accurate
method?  That is, are there any tools that will analyze a thread at
runtime to determine its maximum use?  For example, would the profiler
do something like this?

I realize that the stack usage may differ from run to run based on the
conditions at runtime, but this would nevertheless be useful.

Thanks.
- Keith

-- 
--------------------------------------------------------------------------
Keith Bennett                            Bennett Business Solutions, Inc.
C++/C Software Development               1852 Middlebridge Drive
kbennett@cpcug.org                       Silver Spring, MD USA 20906
Re: Tool to determine stack usage?
#202
Author: Michael Hemsworth
Date: Fri, 30 Sep 1994 13:05
21 lines
1644 bytes
In <36fe1t$pq4@cpcug.org>, kbennett@cpcug.org (Keith Bennett) writes:
>I make an educated guess when determining the stack size for a new
>thread.  Does anyone have any suggestion as to a more accurate
>method?

Keith:

Checkout the DosGetInfoBlocks function in the Dos API,
(page 2-129 of the Control Program Programming Reference).
It returns the address of TIB (thread info block) of the current thread
       and the address of PIB (process info block) of the current process.
There are two fields in the TIB that contain the base and end address
of the current thread's stack.

HTH.
	mike

  Michael Hemsworth                Voice    : 416-979-5000 x 7422
  Ryerson Polytechnic University   Fax      : 416-979-5203
  Toronto                          Internet : mhemswor@acs.ryerson.ca
  Earth                            www      : http://mhh.rcc.ryerson.ca
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads