Curtis L. Olson writes:
>
> Norman Vine writes:
> > David Megginson writes:
> > >
> > > Norman Vine writes:
> > >
> > >  > This should work fine, the only thing I am worried about is that it
> > >  > seems as if every sub component of FGFS is passing a double dt in
> > >  > both the initialization and the update function.  Then locally
> > >  > storing a double elapsed variable to compare against.
> > >
> > > There might be some legacy code that does that, but nothing recent
> > > should.  The subsystem manager automatically takes care of minimum
> > > time slices: for example, if you want to make sure that a subsystem is
> > > never updated more than 5 times per second, you would just do this:
> > >
> > >   globals->add_subsystem("my-subsystem",
> > >                          new MySubsystem,
> > >                          FGSubsystemMgr::GENERAL,
> > >                          0.2);
> > >
> > > The subsystem manager automatically takes care of the timeslice, and
> > > will not invoke the subsystem's update method until at least 0.2
> > > seconds has elapsed.
> >
> > Yes this is better but ... you are still checking every possible event
> > at every iteration and doing a quadword add compare and store
> > each time
> >
> > The event queue model is more efficient esp when you get many
> > subsytems Linux's success as a RT platform has demonstrated
> > this well :-)
>
> Are you sure that's true?

Yes !

> The event queue still needs to check every
> event every iteration to see if anything is ready to run ...

Not if the event queue is ordered by next run time !

All you have todo is process those items whose time stamp
is less then when the queue traversal began and be sure that the
queue remains ordered.

Cheers

Norman


_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to