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:
D3athrow
2015-06-15 15:13:24 -05:00
parent fdbf535079
commit cea4e4e00c
7 changed files with 19 additions and 3 deletions

View File

@@ -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()

View File

@@ -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...

View File

@@ -22,3 +22,4 @@
air_processing_killed = TRUE
air_master.failed_ticks = 0
scheck()

View File

@@ -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

View File

@@ -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