Skip to main content
Discovery icon for Minecraft Computer Mods Discord server

Minecraft Computer Mods

2,588 Online
7,346 Members
# computercraft3 people

ComputerCraft parallel yield

Parallel execution in ComputerCraft allows multiple 'yielding' actions to occur simultaneously, which is beneficial for multiple world actions rather than computation, though confusion exists about event limits.

  • Actions that 'yield' (like `barrel.list()`) take one tick, and `parallel.waitForAll()` or `parallel.waitForAny()` allow multiple yielding actions to be processed simultaneously.
  • Parallelism is useful for simultaneous world actions, not for general computation, suggesting each thread can act as an agent using global variables for communication, e.g., one thread scanning entities.
  • One member initially believed there was a limit of 128 or 256 for parallel events, based on polling items, but this was clarified as a misunderstanding because `print()` does not yield and the example code was event-less.
  • Caching item details is suggested to reduce repeated calls to `getItemDetails`, especially for frequently encountered items, as parallel calls can process many items efficiently (e.g., 200 calls in 0.2ms, though the 0.2ms value was debated against the 50ms tick rate).
Summarized from recent messages, might be inaccurate

More conversations

Talk, Play, &
Hang Out

Find your space to hang out, discuss the latest updates with the party chat, and see who's down to join your next match.
Get App