{"action":"created","issue":{"url":"https://api.github.com/repos/ParadiseSS13/Paradise/issues/1540","labels_url":"https://api.github.com/repos/ParadiseSS13/Paradise/issues/1540/labels{/name}","comments_url":"https://api.github.com/repos/ParadiseSS13/Paradise/issues/1540/comments","events_url":"https://api.github.com/repos/ParadiseSS13/Paradise/issues/1540/events","html_url":"https://github.com/ParadiseSS13/Paradise/pull/1540","id":95842799,"number":1540,"title":"Process and Process Scheduler Tweaks","user":{"login":"Krausus","id":10916307,"avatar_url":"https://avatars.githubusercontent.com/u/10916307?v=3","gravatar_id":"","url":"https://api.github.com/users/Krausus","html_url":"https://github.com/Krausus","followers_url":"https://api.github.com/users/Krausus/followers","following_url":"https://api.github.com/users/Krausus/following{/other_user}","gists_url":"https://api.github.com/users/Krausus/gists{/gist_id}","starred_url":"https://api.github.com/users/Krausus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Krausus/subscriptions","organizations_url":"https://api.github.com/users/Krausus/orgs","repos_url":"https://api.github.com/users/Krausus/repos","events_url":"https://api.github.com/users/Krausus/events{/privacy}","received_events_url":"https://api.github.com/users/Krausus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ParadiseSS13/Paradise/labels/Do%20Not%20Merge","name":"Do Not Merge","color":"612B2B"},{"url":"https://api.github.com/repos/ParadiseSS13/Paradise/labels/Performance","name":"Performance","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":23,"created_at":"2015-07-18T17:19:52Z","updated_at":"2015-08-08T23:32:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ParadiseSS13/Paradise/pulls/1540","html_url":"https://github.com/ParadiseSS13/Paradise/pull/1540","diff_url":"https://github.com/ParadiseSS13/Paradise/pull/1540.diff","patch_url":"https://github.com/ParadiseSS13/Paradise/pull/1540.patch"},"body":"Some tweaks to processes and the process scheduler. The biggest changes are making processes not process faster than intended when the server lags, and making processes that must defer not skip half of the ticks they could be spending processing. Massive raging plasma fires still won't be lagless, but they *should* be better now. Won't know for sure until it's running on the live server.\r\n\r\n* Makes the process scheduler schedule processes according to **game time** instead of **real time**.\r\n  * This effectively meant that, if the server was lagging, the process scheduler would run processes faster than intended, making the server lag *more.*\r\n* Processes that exceed their CPU threshold will now sleep until the next tick, instead of sleeping a whole decisecond.\r\n  * In our case, they would skip half the processing they could be doing.\r\n* Several processes now run at different times across the standard 2-second processing window, rather than all trying to run at the same time.\r\n* LINDA's process now schecks as it is processing turfs.\r\n* Update queues are no longer used by any process, and no longer included in compilation.\r\n  * They didn't seem to really do anything useful that the process scheduler didn't already do, except spawn a *lot.*\r\n* Removes the unused disease process.\r\n  * Also removes the global list it tried to process.\r\n* Adds exception handling to the major processes.\r\n* Integrates the garbage collection code into the garbage collector process.\r\n  * Includes schecking in garbage collection.\r\n* Moves process stat panel output into the process code itself.\r\n  * Reformatted the output to the stat panel, including more information for some processes.\r\n  * Shortened some particularly long process names to make them stretch the first column less.\r\n* Moves part of the lighting process into a new file in the Processes folder, alongside the other processes.\r\n* Fixes some airlocks sometimes sleeping and slowing down the machinery process.\r\n\r\n--\r\n\r\n- Integrates Volundr's btime library and associated process scheduler changes.\r\n  - btime is implemented separately from the process scheduler, as precise time measurement is also useful elsewhere.\r\n    - `TimeOfHour` is no longer internally throttled; throttling is instead done by `SCHECK`.\r\n    - If btime's `gettime` cannot be called at world startup, an error will be output and the world will stop.\r\n  - Retains the change to schedule processes according to game time, rather than real time.\r\n- Removes the (now unused) update queue files.\r\n- Removes the process scheduler testing files.\r\n  - These are standalone tests for the process scheduler, completely unrelated to its use in the full codebase. We never used them.\r\n- Moves the process scheduler defines into __DEFINES.\r\n- Makes the lighting process run once before the round starts.\r\n- Renames `scheck` to `sleepCheck`, to ensure any code that tries to use `scheck` will fail to compile.\r\n- Adds `SCHECK` and `SCHECK_EVERY` macros that skip calling `sleepCheck` entirely until a specified number of `SCHECK`s (50 by default) have been called.\r\n- Makes most processes iterate using their `last_object` variable, allowing hang recovery to show the type that caused the hang.\r\n- Makes processes output an error when they filter out a type they refuse to process.\r\n- Rolls the recently-added alarm subsystem into the alarm process.\r\n  - Removes the now unused subsystems code."},"comment":{"url":"https://api.github.com/repos/ParadiseSS13/Paradise/issues/comments/129069977","html_url":"https://github.com/ParadiseSS13/Paradise/pull/1540#issuecomment-129069977","issue_url":"https://api.github.com/repos/ParadiseSS13/Paradise/issues/1540","id":129069977,"user":{"login":"Krausus","id":10916307,"avatar_url":"https://avatars.githubusercontent.com/u/10916307?v=3","gravatar_id":"","url":"https://api.github.com/users/Krausus","html_url":"https://github.com/Krausus","followers_url":"https://api.github.com/users/Krausus/followers","following_url":"https://api.github.com/users/Krausus/following{/other_user}","gists_url":"https://api.github.com/users/Krausus/gists{/gist_id}","starred_url":"https://api.github.com/users/Krausus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Krausus/subscriptions","organizations_url":"https://api.github.com/users/Krausus/orgs","repos_url":"https://api.github.com/users/Krausus/repos","events_url":"https://api.github.com/users/Krausus/events{/privacy}","received_events_url":"https://api.github.com/users/Krausus/received_events","type":"User","site_admin":false},"created_at":"2015-08-08T23:32:11Z","updated_at":"2015-08-08T23:32:11Z","body":"Just a few minor changes...\r\n\r\n- Removes unused btime globals.\r\n- Removes unnecessary multiplication.\r\n- Makes the garbage collector run twice as often, but do half as much work.\r\n- Makes the garbage collector SCHECK more often when performing hard deletions.\r\n- Adds a delay to the garbage collector's start.\r\n\r\nThis should be good to go. We'll have to see how it fares on the live server."}}