Jump to content
PrizraK11

Scheduled and non - scheduled environments

Recommended Posts

Hi!

I read about this topic on the wiki, but didn't fully understand how it works. Is it possible to provide a couple of examples on this topic (code) with an explanation?

1) Scheduled environment
2) Non - scheduled environments
3) How are they related/or how do they combine with each other?

Share this post


Link to post
Share on other sites

You might want to also read the ACE team's page regarding scheduling: https://ace3.acemod.org/wiki/development/arma-3-scheduler-and-our-practices

 

I'm trying to formulate a simple analogy for how it all works, but it keeps getting more complicated than I'd like. However, it's essentially as it sounds.

 

Scheduled work is processed in order. Each piece of work gets the same amount of time as every other piece. EDIT: The scheduler only has so much time, so it is possible that not all work will be done in each frame.

 

Sometimes, pieces that are not on the schedule must be processed immediately, to completion, and without delay. This is unscheduled work.

 

EDIT: While it might seem like a good idea to schedule all of your work, you must remember that some work may not run on each frame. This can lead to timing issues/errors.

 

On the other hand, running lots of complex unscheduled work can increase frametime/decrease framerate. It is a balancing act.

 

I absolutely welcome any additions/corrections/clarifications to the above, as I am clearly not an authority on the subject!

 

EDIT: Thanks to Larrow for the correction below!

Share this post


Link to post
Share on other sites
18 hours ago, Harzach said:

While it might seem like a good idea to schedule all of your work, you must remember that the more work you schedule, the less time each piece is given.

That is not actually true, the scheduler has a fixed amount of time it runs for, 3ms each frame. It will do as many schedule codes as it can in this time, each piece done is moved to the back of the queue, next time the scheduler starts it will pull the next from the front of the queue.

So each schedule code gets as long as it needs to process( up to 3ms, if a particular code takes longer than 3ms it will be paused where it got to and sent to the back of the queue, the next time it is run by the scheduler it will continue where it left off ). Adding more code to scheduler than can be done in the 3ms just means it may take more frames before that piece of code is run again.

e.g you have three pieces of code scheduled that each take 1ms to process, so each code will be processed every frame.

If you have four pieces that each take 1ms then first frame 1,2 and 3 will be done, next frame 4,1 and 2, next frame 3,4 and 1 etc etc

 

So they don't get less time, they get processed less frequently if the scheduler has more stuff in it than can be processed each frame( 3ms ).

  • Like 1
  • Thanks 2

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×