This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Error on Cyg_Counter::add_alarm


I do not think there is a "rule of thumb". There is a crude way of founding
out how much stack you need:
In your development system ( it would typically have way more memory
installed compared to production one )  allocate as much as you can for
stacks and fill the stack mem space with some pattern ( eg AA55 ). Run the
system under stress and see how much of "patterned" stack space was
overwritten for every task. Set your production system stacks to these sizes
plus some slack 

Cheers
Ark

----Original Message-----
From: Anthony Tonizzo [mailto:atonizzo@lycos.com]
Sent: Monday, 24 May 2004 06:04
To: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] Error on Cyg_Counter::add_alarm


Matt:

>I had some problems with alarms several months ago in
>the FreeBSD stack, but I can't remember the details. 

Fortunately it turns out to have been a very simple
mistake. The stack space allocated for the process was
too small, and when the second task kicked in, it was
probably overwriting the stack of the first. I still wonder
how I got away with this for so long, but once it was
increased to a much bigger size all issues disappeared.

Which brings up an interesting subject, which I am sure
can be of interest to many, especially those working in
somewhat "restricted spaces":

How do you estimate the amount of stack space needed for
a given task? 

I can estimate what _my_own_ stack requirements are, but 
how much more do I have to plan for the "ecos" stuff? When 
I ran these tasks I assumed that 8K were going to suffice,
but evidently that was not the case. Now, bitten once, I
jacked up the size to 32K, but that is probably an overkill,
and I can get away with it because my system has several
megabytes of memory. 

But besides the fact that having a lot of memory doesn't
mean that you have to throw it away, a lot of folks out 
there do not have this luxury and have to make much more
reasoned assessments.

Is there a rule of thumb that the "gurus" out there use?

Thanks
Tony


____________________________________________________________
Find what you are looking for with the Lycos Yellow Pages
http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp
?SRC=lycos10

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]