mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 23:53:47 +01:00
Process and Process Scheduler Tweaks
This commit is contained in:
@@ -9,14 +9,14 @@
|
||||
|
||||
// A list of types that were queued in the GC, and had to be soft deleted; used in testing
|
||||
var/list/gc_hard_del_types = list()
|
||||
var/datum/garbage_collector/garbageCollector
|
||||
var/global/datum/controller/process/garbage_collector/garbageCollector
|
||||
|
||||
// The time a datum was destroyed by the GC, or null if it hasn't been
|
||||
/datum/var/gcDestroyed
|
||||
// Whether a datum was hard-deleted by the GC; 0 if not, 1 if it was queued, -1 if directly deleted
|
||||
/datum/var/hard_deleted = 0
|
||||
|
||||
/datum/garbage_collector
|
||||
/datum/controller/process/garbage_collector
|
||||
var/list/queue = new
|
||||
var/del_everything = 0
|
||||
|
||||
@@ -25,7 +25,7 @@ var/datum/garbage_collector/garbageCollector
|
||||
var/hard_dels = 0
|
||||
var/soft_dels = 0
|
||||
|
||||
/datum/garbage_collector/proc/addTrash(var/datum/D)
|
||||
/datum/controller/process/garbage_collector/proc/addTrash(var/datum/D)
|
||||
if(!istype(D) || del_everything)
|
||||
del(D)
|
||||
hard_dels++
|
||||
@@ -35,7 +35,7 @@ var/datum/garbage_collector/garbageCollector
|
||||
queue -= "\ref[D]" // If this is a re-used ref, remove the old ref from the queue
|
||||
queue["\ref[D]"] = world.time
|
||||
|
||||
/datum/garbage_collector/proc/process()
|
||||
/datum/controller/process/garbage_collector/proc/processGarbage()
|
||||
var/remainingCollectionPerTick = GC_COLLECTIONS_PER_TICK
|
||||
var/remainingForceDelPerTick = GC_FORCE_DEL_PER_TICK
|
||||
var/collectionTimeScope = world.time - GC_COLLECTION_TIMEOUT
|
||||
@@ -64,6 +64,7 @@ var/datum/garbage_collector/garbageCollector
|
||||
queue.Cut(1, 2)
|
||||
soft_dels++
|
||||
dels_count++
|
||||
scheck()
|
||||
|
||||
#ifdef GC_DEBUG
|
||||
#undef GC_DEBUG
|
||||
@@ -73,7 +74,7 @@ var/datum/garbage_collector/garbageCollector
|
||||
#undef GC_COLLECTION_TIMEOUT
|
||||
#undef GC_COLLECTIONS_PER_TICK
|
||||
|
||||
/datum/garbage_collector/proc/hardDel(var/datum/D)
|
||||
/datum/controller/process/garbage_collector/proc/hardDel(var/datum/D)
|
||||
gc_hard_del_types |= D.type
|
||||
D.hard_deleted = 1
|
||||
if(!D.gcDestroyed)
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
var/global/datum/controller/process/lighting/lighting_controller
|
||||
|
||||
/datum/controller/process/lighting/setup()
|
||||
name = "lighting"
|
||||
schedule_interval = LIGHTING_INTERVAL
|
||||
lighting_controller = src
|
||||
|
||||
create_lighting_overlays()
|
||||
/datum/controller/process/lighting
|
||||
var/last_light_count = 0
|
||||
var/last_overlay_count = 0
|
||||
|
||||
/datum/controller/process/lighting/doWork()
|
||||
var/list/lighting_update_lights_old = lighting_update_lights //We use a different list so any additions to the update lists during a delay from scheck() don't cause things to be cut from the list without being updated.
|
||||
last_light_count = lighting_update_lights.len
|
||||
lighting_update_lights = list()
|
||||
|
||||
for(var/datum/light_source/L in lighting_update_lights_old)
|
||||
@@ -22,6 +18,7 @@ var/global/datum/controller/process/lighting/lighting_controller
|
||||
scheck()
|
||||
|
||||
var/list/lighting_update_overlays_old = lighting_update_overlays //Same as above.
|
||||
last_overlay_count = lighting_update_overlays.len
|
||||
lighting_update_overlays = list()
|
||||
|
||||
for(var/atom/movable/lighting_overlay/O in lighting_update_overlays_old)
|
||||
|
||||
+5
-70
@@ -926,77 +926,12 @@ var/list/slot_equipment_priority = list( \
|
||||
if(client && client.holder)
|
||||
|
||||
if(statpanel("DI")) //not looking at that panel
|
||||
stat(null, "Location:\t([x], [y], [z])")
|
||||
stat(null, "CPU:\t[world.cpu]")
|
||||
stat(null, "Instances:\t[world.contents.len]")
|
||||
stat("Loc", "([x], [y], [z]) [loc]")
|
||||
stat("CPU", "[world.cpu]")
|
||||
stat("Instances", "[world.contents.len]")
|
||||
|
||||
if (garbageCollector)
|
||||
stat(null, "\tqdel - [garbageCollector.del_everything ? "off" : "on"]")
|
||||
stat(null, "\ton queue - [garbageCollector.queue.len]")
|
||||
stat(null, "\ttotal delete - [garbageCollector.dels_count]")
|
||||
stat(null, "\tsoft delete - [garbageCollector.soft_dels]")
|
||||
stat(null, "\thard delete - [garbageCollector.hard_dels]")
|
||||
else
|
||||
stat(null, "Garbage Controller is not running.")
|
||||
|
||||
if(processScheduler.getIsRunning())
|
||||
var/datum/controller/process/process
|
||||
|
||||
process = processScheduler.getProcess("ticker")
|
||||
stat(null, "TIC\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
|
||||
|
||||
process = processScheduler.getProcess("air")
|
||||
stat(null, "AIR\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
|
||||
|
||||
process = processScheduler.getProcess("lighting")
|
||||
stat(null, "LIG\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
|
||||
|
||||
process = processScheduler.getProcess("mob")
|
||||
stat(null, "MOB([mob_list.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
|
||||
|
||||
process = processScheduler.getProcess("machinery")
|
||||
stat(null, "MAC([machines.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
|
||||
|
||||
process = processScheduler.getProcess("obj")
|
||||
stat(null, "OBJ([processing_objects.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
|
||||
|
||||
process = processScheduler.getProcess("bot")
|
||||
stat(null, "BOT([aibots.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
|
||||
|
||||
process = processScheduler.getProcess("pipenet")
|
||||
stat(null, "PIP([pipe_networks.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
|
||||
|
||||
process = processScheduler.getProcess("nanoui")
|
||||
stat(null, "NAN([nanomanager.processing_uis.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
|
||||
|
||||
process = processScheduler.getProcess("disease")
|
||||
stat(null, "DIS([active_diseases.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
|
||||
|
||||
process = processScheduler.getProcess("garbage")
|
||||
stat(null, "GAR\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
|
||||
|
||||
process = processScheduler.getProcess("sun")
|
||||
stat(null, "SUN([sun.solars.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
|
||||
|
||||
//process = processScheduler.getProcess("garbage")
|
||||
//stat(null, "GAR\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
|
||||
|
||||
//process = processScheduler.getProcess("vote")
|
||||
//stat(null, "VOT\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
|
||||
|
||||
//process = processScheduler.getProcess("shuttle controller")
|
||||
//stat(null, "SHT\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
|
||||
|
||||
//process = processScheduler.getProcess("emergency shuttle")
|
||||
//stat(null, "EME\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
|
||||
|
||||
//process = processScheduler.getProcess("inactivity")
|
||||
//stat(null, "IAC\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
|
||||
|
||||
//process = processScheduler.getProcess("event")
|
||||
//stat(null, "EVE([events.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
|
||||
else
|
||||
stat(null, "processScheduler is not running.")
|
||||
if(processScheduler)
|
||||
processScheduler.statProcesses()
|
||||
|
||||
statpanel("Status") // Switch to the Status panel again, for the sake of the lazy Stat procs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user