N
Nicholas Poole
Hi,
My problem is that I want a function to start as a new thread every time
it's called, hence allowing the loop to continue and spawn a thread for
each iteration of the loop. Currently my loop waits for the function to
end before it continues. If anyone can anyone tell me what I'm missing,
or even refer me to some good documentation, I'd be grateful.
My current code is as follows:
cl.add_message_callback do |m|
if m.type != :error
#break off
newreplythread = Thread.new(cl, m) {
#function call is here
}
end
}
(Maybe I'm mistaking the loop for something else, but it's behaviour
apears the same)
Thanks
NickPoole
My problem is that I want a function to start as a new thread every time
it's called, hence allowing the loop to continue and spawn a thread for
each iteration of the loop. Currently my loop waits for the function to
end before it continues. If anyone can anyone tell me what I'm missing,
or even refer me to some good documentation, I'd be grateful.
My current code is as follows:
cl.add_message_callback do |m|
if m.type != :error
#break off
newreplythread = Thread.new(cl, m) {
#function call is here
}
end
}
(Maybe I'm mistaking the loop for something else, but it's behaviour
apears the same)
Thanks
NickPoole