From 1c20c935136460609aa41f9636552e0eb2e24402 Mon Sep 17 00:00:00 2001 From: Mikayla Date: Wed, 24 May 2023 09:42:04 -0400 Subject: [PATCH] Updated Threading (markdown) --- Threading.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Threading.md b/Threading.md index 2535922..5aa5648 100644 --- a/Threading.md +++ b/Threading.md @@ -1 +1,13 @@ -# Reactor PLC and RTU Pseudo-Threading \ No newline at end of file +# Reactor PLC and RTU Pseudo-Threading + +The PLC and RTUs utilize co-routines to act as a multi-threading system. There is one "main" co-routine on each of those devices that is responsible for handling the OS event queue, and then auxiliary co-routines for handling various tasks. This allows the auxiliary co-routines to run commands that would consume the event queue, namely Mekanism API calls. Bringing those functions out of the main co-routine means that it will always get all the incoming events, rather than some of them being consumed by Mekanism functions waiting for `task_complete` events. + +## Reactor PLC + +The reactor PLC has 5 co-routines running via the ComputerCraft `parallel` API: + +- Main Thread +- RPS Thread +- Communications Tx (Transmit) Thread +- Communications Rx (Receive) Thread +- Setpoint Control Thread \ No newline at end of file