Jump to content
Blitzen88

Scheduler Load and Looping Scripts

Recommended Posts

Greetings,

 

My understanding is the Spawn and ExecVM commands allow for the scheduler to execute scripts when time allows for it based upon the current engine load.  I believe the Exec command, however, executes scripts immediately when “called.”

 

However, how does the scheduler handle looping scripts which are initially executed via the Spawn and ExecVM commands?  For instance, say I execute a script via Spawn/ExecVM and it loops every 3 minutes.  Will the scheduler delay the execution of the loop since the script was initially called with Spawn/ExecVM?

 

Thanks

Share this post


Link to post
Share on other sites

And don't exexVM an sqf in a loop, you multiply compilation of codes for nuts. Create a function and spawn it in loop. Follow links.

Share this post


Link to post
Share on other sites
1 hour ago, pierremgi said:

And don't exexVM an sqf in a loop, you multiply compilation of codes for nuts. Create a function and spawn it in loop. Follow links.

Im NOT talking about this:

 

while (true) do { execVM script; sleep 1}
 

Im talking about this:

 

while (true) do { something; sleep 1}
 

How does the scheduler deal with the loop?

Share this post


Link to post
Share on other sites
16 minutes ago, Blitzen88 said:

while (true) do { something; sleep 1}
 

How does the scheduler deal with the loop?

 

It depends on what "something" is and what else is going on. Which is why code optimization can be so important.

Share this post


Link to post
Share on other sites
1 hour ago, pierremgi said:

Follow links.

This!

Share this post


Link to post
Share on other sites
1 minute ago, sarogahtyp said:

This!

Will do. Thank you!

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

×