This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: Adjusting stack sizes
- To: "ecos" <ecos-discuss at sources dot redhat dot com>,Rafael Rodríguez Velilla <rrv at tid dot es>
- Subject: RE: [ECOS] Adjusting stack sizes
- From: "Dan Bolstad" <danb at iobjects dot com>
- Date: Thu, 30 Aug 2001 09:07:49 -0700
It sounds like you want the functions defined in
<cyg/kernel/test/stackmon.h>.
This function is very helpful when tuning stack sizes:
cyg_test_dump_thread_stack_stats( char *comment, Cyg_Thread *p );
Run your thread at it's highest possible stack usage, use this function
as a test diagnostic, and trim down near that. And be careful... If
you cut back the stack too far, you'll likely overflow your stack and
get very unpredictable bugs which are painful to track down.
-Dan
*
* Dan Bolstad
* Software Engineer, Interactive Objects
* danb@iobjects.com 425.289.0327
*
-----Original Message-----
From: Rafael Rodríguez Velilla [mailto:rrv@tid.es]
Sent: Thursday, August 30, 2001 1:53 AM
To: ecos
Subject: Re: [ECOS] Adjusting stack sizes
"Simpkins, Andy" wrote:
> I assume that you mean whilst the thread is active? I am not sure
that that
> can be done (simply)...
>
> However if you mean before you create the thread (which I am sure you
don't)
> then the stack size is specified as part of cyg_thread_create
I don't want to create a thread that adjusts its stack size at run
time. I
want to create applications with threads that don't use too much thread
stack
space, so I'd want to know how do the others calculate the space
required by a
thread.
I have seen a member "stack_limit" and two methods
"increment_stack_limit"
and "get_stack_limit" in the Cyg_Thread class that I think that are
supposed to
help the developers adjust their stacks doing some kind of run-time
simulation... but I don't know how to use that.
--
Rafael Rodríguez Velilla rrv@tid.es
Telefónica I+D http://www.tid.es
Telf: +34 - 91 337 4270