comp.lang.ada
 help / color / mirror / Atom feed
* How to calculate optimum task size?
@ 2004-01-04 22:30 Baris Gokbudak
  2004-01-04 23:01 ` Stephane Richard
  2004-01-04 23:42 ` Jeff C,
  0 siblings, 2 replies; 5+ messages in thread
From: Baris Gokbudak @ 2004-01-04 22:30 UTC (permalink / raw)


Hi.
At work we are using default sizes for tasks.But we have a memory size
problem and as we are doing a real time system we should minimize the
task sizes etc.But when we set a smaller size for a task we are not
sure if it is the optimum size for that size.Is there any way to
calculate the optimum task size for a task?We are compiling the
project in Sparc 5 SUN.The real time system is used in VXWorks
operating system.
I am looking forward for any suggestion.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to calculate optimum task size?
  2004-01-04 22:30 How to calculate optimum task size? Baris Gokbudak
@ 2004-01-04 23:01 ` Stephane Richard
  2004-01-04 23:58   ` Robert I. Eachus
  2004-01-04 23:42 ` Jeff C,
  1 sibling, 1 reply; 5+ messages in thread
From: Stephane Richard @ 2004-01-04 23:01 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1061 bytes --]

I'm not quite sure what you mean by Optimal task size.  if you're looking
for the best size as far as speed is concerned, in my past I've found that
giving tasks a size of 2^X somehow works faster.  hence 1024 instead 1000
bytes for example.

If you're wondering if the task size influences what the task can handle as
far as capacity goes I'll let the gurus here answer that part of it :-).

-- 
St�phane Richard
"Ada World" Webmaster
http://www.adaworld.com


"Baris Gokbudak" <bgokbudak@yahoo.com> wrote in message
news:c9267c2d.0401041430.4aeefc2@posting.google.com...
> Hi.
> At work we are using default sizes for tasks.But we have a memory size
> problem and as we are doing a real time system we should minimize the
> task sizes etc.But when we set a smaller size for a task we are not
> sure if it is the optimum size for that size.Is there any way to
> calculate the optimum task size for a task?We are compiling the
> project in Sparc 5 SUN.The real time system is used in VXWorks
> operating system.
> I am looking forward for any suggestion.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to calculate optimum task size?
  2004-01-04 22:30 How to calculate optimum task size? Baris Gokbudak
  2004-01-04 23:01 ` Stephane Richard
@ 2004-01-04 23:42 ` Jeff C,
  2004-01-05  2:21   ` Ed Falis
  1 sibling, 1 reply; 5+ messages in thread
From: Jeff C, @ 2004-01-04 23:42 UTC (permalink / raw)


I have seen tools that claim to be able to compute worste case stack usage
(assuming no recursive calls) but I have
never been in a position to make use of them.
(Aonix has something called TSAT
http://www.acm.org/sigada/wg/asiswg/ASIS_Clients.html)


I usually try to make an initial sloppy estimate by doing a hand roll-up of
object sizes walking down a call tree (it
usually sounds scarier than it is for most tasks)..Then (for vxWorks) let
the system run for a while ...Especially if you
can present the system with "worste case" date. Then do a

checkStack

From the target shell.

It should show the the high water mark for stack usage for all tasks. I
usually (assuming I can afford the memory)
will then set default stack sizes 2x the high water level (unless it
conflicts with the hand estimate).

 Except for some special cases you sometimes have to avoid
(like aggregate assignment into a large structure on some compilers) most
tasks need very little stack size so
even the 2x value ends up using a very small ammount of the total memory.

"Baris Gokbudak" <bgokbudak@yahoo.com> wrote in message
news:c9267c2d.0401041430.4aeefc2@posting.google.com...
> Hi.
> At work we are using default sizes for tasks.But we have a memory size
> problem and as we are doing a real time system we should minimize the
> task sizes etc.But when we set a smaller size for a task we are not
> sure if it is the optimum size for that size.Is there any way to
> calculate the optimum task size for a task?We are compiling the
> project in Sparc 5 SUN.The real time system is used in VXWorks
> operating system.
> I am looking forward for any suggestion.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to calculate optimum task size?
  2004-01-04 23:01 ` Stephane Richard
@ 2004-01-04 23:58   ` Robert I. Eachus
  0 siblings, 0 replies; 5+ messages in thread
From: Robert I. Eachus @ 2004-01-04 23:58 UTC (permalink / raw)


Stephane Richard wrote:

> I'm not quite sure what you mean by Optimal task size.  if you're looking
> for the best size as far as speed is concerned, in my past I've found that
> giving tasks a size of 2^X somehow works faster.  hence 1024 instead 1000
> bytes for example.
> 
> If you're wondering if the task size influences what the task can handle as
> far as capacity goes I'll let the gurus here answer that part of it :-).

I could probably spend three years trying to answer that, and not cover 
all the important issues.

In safety-critical the usual approach is to have a fixed number of 
tasks, and for each of those tasks to have a call tree with no 
recursion.  Each call has should have fixed stack requirements.  That 
way you can compute the maximum possible stack size requirement for each 
task.  Of course, you also want to have a limit on heap allocations. 
Some organizations have rules that require no heap allocations. The 
rules I prefer allow explicit heap allocations, but only during 
initialization.

If you really need to solve this problem get some books on real-time and 
safety-critical programming, then choose a set of design tools that you 
will use to do the analysis.  (It is painful to keep track of the 
requirements as you make modifications, fix bugs, etc.)

Does all this double or triple the cost of the software?  Yes, welcome 
to the world of hard-real time and safety-critical software.  (What 
makes real-time software hard real-time?  The difficultly of meeting all 
the requirements. ;-)


-- 
                                           Robert I. Eachus

"The war on terror is a different kind of war, waged capture by capture, 
cell by cell, and victory by victory. Our security is assured by our 
perseverance and by our sure belief in the success of liberty." -- 
George W. Bush




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to calculate optimum task size?
  2004-01-04 23:42 ` Jeff C,
@ 2004-01-05  2:21   ` Ed Falis
  0 siblings, 0 replies; 5+ messages in thread
From: Ed Falis @ 2004-01-05  2:21 UTC (permalink / raw)


The addresses on that link have to be out of date.  Aonix shut that office 
down in January of 2000.  I ought to know.

- Ed



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-01-05  2:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-04 22:30 How to calculate optimum task size? Baris Gokbudak
2004-01-04 23:01 ` Stephane Richard
2004-01-04 23:58   ` Robert I. Eachus
2004-01-04 23:42 ` Jeff C,
2004-01-05  2:21   ` Ed Falis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox