From: Jon Handler Date: 2007-10-13T08:51:32+09:00 Subject: Is there a standard pattern for threaded access to a file? I'm pretty new to ruby and this is one of those areas where I can't quite seem to turn my head inside out as the language requires :-) I have a log file that I want to process in parts, with multiple threads working from the same file, each one getting a line at a time and doing something with it. I'd like something like 1. Open the file 2. Create 5 threads Each thread should read a line of the file and process it, but no 2 threads should get the same line. What I have looks like open (ARGV.flags.log) do |logfile| logfile.each do |line| blah blah blah... end end but that's inside out! How do I rubify this code? Thanks, Jon -- Posted via http://www.ruby-forum.com/.