mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
break everything again, scheck and other loop sleeps now sleep for a proper 10th of a second instead of just 1 tick at whatever FPS. Throw some scheck like calls in the zas ticker.
This commit is contained in:
@@ -196,7 +196,7 @@ datum/controller/process/proc/scheck(var/tickId = 0)
|
||||
// For each tick the process defers, it increments the cpu_defer_count so we don't
|
||||
// defer indefinitely
|
||||
if (world.cpu >= cpu_threshold + cpu_defer_count * 10)
|
||||
sleep(1)
|
||||
sleep(calculateticks(1))
|
||||
cpu_defer_count++
|
||||
last_slept = world.timeofday
|
||||
else
|
||||
@@ -206,7 +206,7 @@ datum/controller/process/proc/scheck(var/tickId = 0)
|
||||
|
||||
if (world.timeofday > last_slept + sleep_interval)
|
||||
// If we haven't slept in sleep_interval ticks, sleep to allow other work to proceed.
|
||||
sleep(0)
|
||||
sleep(calculateticks(1))
|
||||
last_slept = world.timeofday
|
||||
|
||||
datum/controller/process/proc/update()
|
||||
|
||||
@@ -46,7 +46,7 @@ datum/updateQueueWorker/proc/doWork()
|
||||
// in the next tick.
|
||||
uq_dbg("tick went into overtime with world.cpu = [world.cpu], deferred next update to next tick [1+(world.time / world.tick_lag)]")
|
||||
|
||||
spawn(1)
|
||||
spawn(calculateticks(1))
|
||||
doWork()
|
||||
else
|
||||
spawn(0) // Execute anonymous function immediately as if we were in a while loop...
|
||||
|
||||
@@ -22,3 +22,4 @@
|
||||
|
||||
air_processing_killed = TRUE
|
||||
air_master.failed_ticks = 0
|
||||
scheck()
|
||||
@@ -20,6 +20,7 @@ var/global/datum/controller/process/ticker/tickerProcess
|
||||
ticker.pregame()
|
||||
|
||||
/datum/controller/process/ticker/doWork()
|
||||
scheck()
|
||||
var/currentTime = world.timeofday
|
||||
|
||||
if(currentTime < lastTickerTime) // check for midnight rollover
|
||||
|
||||
@@ -63,6 +63,11 @@ var/soft_dels = 0
|
||||
|
||||
hard_dels++
|
||||
remainingForceDelPerTick--
|
||||
if(world.cpu > 80)
|
||||
#ifdef GG_DEBUG
|
||||
WARNING("GC process sleeping due to high CPU usage!")
|
||||
#endif
|
||||
sleep(calculateticks(2))
|
||||
|
||||
#ifdef GC_DEBUG
|
||||
#undef GC_DEBUG
|
||||
|
||||
Reference in New Issue
Block a user