Updated Threading (markdown)

Mikayla 2023-05-24 09:42:04 -04:00
parent f7a266776e
commit 1c20c93513

@ -1 +1,13 @@
# 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