View Single Post
  #6 (permalink)  
Old 11-06-2007, 12:16 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Default Re: MultiThreading in Ruby

Ya..sure…

I've tried 2 things so far. First I defined each thread as function by itself.


First is...

Code:
Thread.new do
#read input file, check input and queue to a queue
end
end
Second one is...

Code:
Thread.new do
#dequeue first 10 object from queue and enqueue to a new queue
#delete redundant object from new and previous queue using a loop
end
end
I think the program couldn't run this way. I can't really recall cos I did this a while back. Is the syntax for this correct? If so how would I run the 2 threads now?
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Reply With Quote