Re: execution time becomes unpredictable?!
"Stephen Sprunk" <stephen@sprunk .org> wrote in message
news:1112291657 .2c150949c15270 17fcfc6778c3e4e a67@teranews...[color=blue]
> "REH" <bogus@nowhere. net> wrote in message
> news:d2ha04$ghh 11@cui1.lmms.lm co.com...[color=green]
> > <vashwath@redif fmail.com> wrote in message
> > news:1112242461 .608598.40730@f 14g2000cwb.goog legroups.com...[color=darkred]
> > > Might be off topic but I don't know where to post this question.
> > > Hope some body clears my doubt.
> > >
> > > The coding standard of the project which I am working on say's
> > > not to use malloc.When I asked my lead(I have just started
> > > working) he said we should not use dynamic allocation in real
> > > time systems, the code will not run in predictable time period.
> > > Can anybody tell what does he mean?Why the execution time
> > > becomes unpredictable?[/color]
> >
> > What that means is the time to execute the call to malloc is
> > non-deterministic. That is, you cannot know exactly how long it
> > will take. The reason it is important in real-time systems, is you
> > have hard dead-lines. You have X amount of time to handle an
> > event. You cannot prove that the software can meet its deal-lines
> > if you call functions with non-deterministic execution times.[/color]
>
> Non-determinism isn't necessarily bad as long as you can prove the[/color]
_maximum_[color=blue]
> time required for all the functions you call (plus your own function)
> doesn't exceed the deadline.[/color]
If you can prove there is a max. time, then it *is* deterministic.
[color=blue]
> The problem with malloc() and free() is that
> there is usually no way to prove the maximum time required for one or the
> other (or sometimes both). I'm not even sure it's possible in theory for
> both.
>[/color]
Yes, hence, non-determinstic. sheesh.
"Stephen Sprunk" <stephen@sprunk .org> wrote in message
news:1112291657 .2c150949c15270 17fcfc6778c3e4e a67@teranews...[color=blue]
> "REH" <bogus@nowhere. net> wrote in message
> news:d2ha04$ghh 11@cui1.lmms.lm co.com...[color=green]
> > <vashwath@redif fmail.com> wrote in message
> > news:1112242461 .608598.40730@f 14g2000cwb.goog legroups.com...[color=darkred]
> > > Might be off topic but I don't know where to post this question.
> > > Hope some body clears my doubt.
> > >
> > > The coding standard of the project which I am working on say's
> > > not to use malloc.When I asked my lead(I have just started
> > > working) he said we should not use dynamic allocation in real
> > > time systems, the code will not run in predictable time period.
> > > Can anybody tell what does he mean?Why the execution time
> > > becomes unpredictable?[/color]
> >
> > What that means is the time to execute the call to malloc is
> > non-deterministic. That is, you cannot know exactly how long it
> > will take. The reason it is important in real-time systems, is you
> > have hard dead-lines. You have X amount of time to handle an
> > event. You cannot prove that the software can meet its deal-lines
> > if you call functions with non-deterministic execution times.[/color]
>
> Non-determinism isn't necessarily bad as long as you can prove the[/color]
_maximum_[color=blue]
> time required for all the functions you call (plus your own function)
> doesn't exceed the deadline.[/color]
If you can prove there is a max. time, then it *is* deterministic.
[color=blue]
> The problem with malloc() and free() is that
> there is usually no way to prove the maximum time required for one or the
> other (or sometimes both). I'm not even sure it's possible in theory for
> both.
>[/color]
Yes, hence, non-determinstic. sheesh.
Comment