This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
natedogith1's profile picture

Multitasking

Started by natedogith1, 01 September 2014 - 02:47 AM
natedogith1 #1
Posted 01 September 2014 - 04:47 AM
I'm wondering if ComputerCraft actually does multitasking (I know it doesn't on a single CC computer). I feel like I've heard things about, though CC uses threads, it only running one at once. I'm trying to decide whether or not it would be worth it to make a bank of computers to allow executing processes faster (rendering 1300+ points from 3d to 2d (using OpenPeripheral Terminal Glasses) is kinda slow, as is 1900+ for drawing a terminal with Terminal Glasses)
Bomb Bloke #2
Posted 01 September 2014 - 05:12 AM
Although it uses threads, it doesn't execute more than one Lua co-routine at a time. While one computer is running code, all other computers are yielding. Therefore, at least within ComputerCraft, clusters are less efficient than single units as parallel processing is impossible.
natedogith1 #3
Posted 01 September 2014 - 05:44 AM
Well that sucks, makes me wonder how popular servers manage to run CC computers at any decent speed though. (maybe people just aren't doing the ridiculous sort of things I like to do)
Is there any reason it's implemented as such?
Edited on 01 September 2014 - 03:45 AM
Bomb Bloke #4
Posted 01 September 2014 - 05:56 AM
Presumably it's so that ComputerCraft doesn't monopolise MineCraft server power, as it should theoretically put an easily managed cap on CPU usage.

I suspect it doesn't quite work out like that, but generally it should mean that if your world is laggy ComputerCraft isn't the culprit.