From: Francis Cianfrocca Date: 2007-10-13T23:29:02+09:00 Subject: Re: Is there a standard pattern for threaded access to a file? ------=_Part_28483_17627615.1192285743535 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 10/12/07, Jon Handler wrote: > > 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. Why are you doing this in the first place? Do you have a computer with five processors and five memory buses? ------=_Part_28483_17627615.1192285743535--