Coder Social home page Coder Social logo

Comments (8)

volundr- avatar volundr- commented on August 26, 2024

The updateQueue is useful, but adds a bit of overhead. The overhead is involved in gracefully handling failures during updates of items in the queue. In essence, if an update hangs on an item in the queue, the rest of the queue is still processed with no issues. You would use this if you had a smallish number of items that may take a long time to update, or may hang while updating. Mobs, for instance. Goonstation has had problems with mob updates hanging the process, so we use updateQueue for that. Mobcode is nuts.

If you have a whole lot of objects that don't take a lot of time to update (machines, pipenets, etc), you don't want to use updateQueue. Just write a loop for those in the process and call scheck() inside the loop.

from processscheduler.

Fox-McCloud avatar Fox-McCloud commented on August 26, 2024

@volundr-

Thanks a bunch, that helps clarify things a lot; much much appreciated!

from processscheduler.

Fox-McCloud avatar Fox-McCloud commented on August 26, 2024

@volundr-

Just another quick question. For deferring process to the next tick (in update queues and scheck), wouldn't it be better/adventageous to defer it for world.tick_lag instead of 1 decisecond?

from processscheduler.

volundr- avatar volundr- commented on August 26, 2024

When scheck decides to defer, the world tick is already going into overtime - deferring for the smallest interval makes it so that the work is simply pushed over into the next world tick, rather than pushing it forward a specific length of time. So deferring for tick_lag would actually push the work farther down the queue than desired.

from processscheduler.

Fox-McCloud avatar Fox-McCloud commented on August 26, 2024

If that's the case then, why was one decisecond chosen? Why not lower, if you want to defer for the smallest interval possible? Correct me if I'm wrong, but wouldn't sleeping tick_lag be less than sleeping for one decisecond? (given that tick_lag is usually 0.9 deciseconds..though some servers utilize 0.5)

If I'm misunderstanding you here, I apologize!

from processscheduler.

volundr- avatar volundr- commented on August 26, 2024

@Fox-McCloud That's a great question actually! I'll do some experiments and see what the effect of sleeping tick_lag versus 1 is.

from processscheduler.

Fox-McCloud avatar Fox-McCloud commented on August 26, 2024

@volundr-

Great! Lemme know how it turns out!

from processscheduler.

MrStonedOne avatar MrStonedOne commented on August 26, 2024

Byond rounds sleep() to the next tick. so you can do sleep(0.01) to ensure you run next tick logical tick.

from processscheduler.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.