* [ECOS] Adjusting stack sizes
@ 2001-08-30 1:43 Rafael RodrÃguez Velilla
0 siblings, 0 replies; 5+ messages in thread
From: Rafael RodrÃÂguez Velilla @ 2001-08-30 1:43 UTC (permalink / raw)
To: ecos
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 206 bytes --]
Does anyone of you use any easy procedure to adjust the stack size of
the threads?
--
Rafael RodrÃguez Velilla rrv@tid.es
Telefónica I+D http://www.tid.es
Telf: +34 - 91 337 4270
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] Adjusting stack sizes
2001-08-30 9:07 Dan Bolstad
@ 2001-09-06 23:43 ` Jonathan Larmour
0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Larmour @ 2001-09-06 23:43 UTC (permalink / raw)
To: Dan Bolstad; +Cc: ecos, Rafael RodrÃÂguez Velilla
Dan Bolstad wrote:
>
> 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 );
That interface is a slightly older one only used for tests (hence the
location of the header). The preferred API to use is:
#ifdef CYGFUN_KERNEL_THREADS_STACK_MEASUREMENT
cyg_uint32 cyg_thread_measure_stack_usage(cyg_handle_t thread);
#endif
Obviously enable the above config option. This version works better in that
it doesn't assume the stack is zero initialized.
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [ECOS] Adjusting stack sizes
@ 2001-08-30 9:07 Dan Bolstad
2001-09-06 23:43 ` Jonathan Larmour
0 siblings, 1 reply; 5+ messages in thread
From: Dan Bolstad @ 2001-08-30 9:07 UTC (permalink / raw)
To: ecos, Rafael RodrÃÂguez Velilla
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1676 bytes --]
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] Adjusting stack sizes
2001-08-30 1:57 Simpkins, Andy
@ 2001-08-30 2:58 ` Rafael RodrÃguez Velilla
0 siblings, 0 replies; 5+ messages in thread
From: Rafael RodrÃÂguez Velilla @ 2001-08-30 2:58 UTC (permalink / raw)
To: ecos
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 916 bytes --]
"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
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [ECOS] Adjusting stack sizes
@ 2001-08-30 1:57 Simpkins, Andy
2001-08-30 2:58 ` Rafael RodrÃguez Velilla
0 siblings, 1 reply; 5+ messages in thread
From: Simpkins, Andy @ 2001-08-30 1:57 UTC (permalink / raw)
To: Rafael RodrÃÂguez Velilla, ecos
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 651 bytes --]
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
Andy
> -----Original Message-----
> From: Rafael RodrÃguez Velilla [ mailto:rrv@tid.es ]
> Sent: 30 August 2001 08:03
> To: ecos
> Subject: [ECOS] Adjusting stack sizes
>
>
> Does anyone of you use any easy procedure to adjust the
> stack size of
> the threads?
>
> --
> Rafael RodrÃguez Velilla rrv@tid.es
> Telefónica I+D http://www.tid.es
> Telf: +34 - 91 337 4270
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-09-06 23:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-30 1:43 [ECOS] Adjusting stack sizes Rafael RodrÃguez Velilla
2001-08-30 1:57 Simpkins, Andy
2001-08-30 2:58 ` Rafael RodrÃguez Velilla
2001-08-30 9:07 Dan Bolstad
2001-09-06 23:43 ` Jonathan Larmour
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).