Posted 11 July 2014 - 03:07 PM
Hey guys,
I am curious, I know parallel can run two functions at once, but it doesn't seem to do well running two non-terminating functions, IE:
This program will only move on to the get() function once it has gathered user input.
What I'd love to do is listen in the background while I was getting user input.
In conventional computing this is done through multiple programs.
But I can't seem to find a way to run two processes at once in CC.
Is this possible? Is there some other way of doing this that I'm missing?
I am curious, I know parallel can run two functions at once, but it doesn't seem to do well running two non-terminating functions, IE:
function input()
choice=io.read()
choice=choice+1-1
print(choice)
end
function get()
rednet.receive()
end
parallel.waitForAll(input(),get())
This program will only move on to the get() function once it has gathered user input.
What I'd love to do is listen in the background while I was getting user input.
In conventional computing this is done through multiple programs.
But I can't seem to find a way to run two processes at once in CC.
Is this possible? Is there some other way of doing this that I'm missing?