Execute when idle

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Execute when idle

by burli » Thu Jun 09, 2016 08:42

Is it there a system in minetest to execute low priority functions if the main loop is idle?

It should be able to add a function to a queue and the function is executed at the end of a frame, if the frame is idle. If the frame takes longer it should be possible to skip some frames.

I don't know if minetest.after works like this. As far as i know minetest.after calles the functions, idle or not.

It should be more like this

Minetest.queue(1, function()) where the 1 is the maximum time to wait. If it is possible, the function could be called earlier.

I think this might help minetest to increase the performance
 

twoelk
Member
 
Posts: 1092
Joined: Fri Apr 19, 2013 16:19

Re: Execute when idle

by twoelk » Thu Jun 09, 2016 09:48

Eek, but
I don't want to be executed for being idle.
I protest in the name of all idledoers.
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: Execute when idle

by burli » Thu Jun 09, 2016 09:52

twoelk wrote:I don't want to be executed for being idle.

No? But idleness is one of the seven deadly sins ;-)
 

User avatar
Glorfindel
Member
 
Posts: 129
Joined: Tue Jul 07, 2015 20:05
GitHub: the1glorfindel
IRC: Glorfindel DoomWeaver
In-game: Glorfindel

Re: Execute when idle

by Glorfindel » Thu Jun 09, 2016 16:35

Me either! It's hard enough remembering to check back to make sure I don't starve!
XD
 


Return to Minetest General

Who is online

Users browsing this forum: Google [Bot] and 17 guests

cron