From: Jon Handler Date: 2007-10-16T01:07:27+09:00 Subject: Re: Is there a standard pattern for threaded access to a fil Francis Cianfrocca wrote: > On 10/12/07, Jon Handler wrote: >> 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? I'm stress-testing my http server... Since most of the time is spent waiting for requests to go and come back, multiple threads on the sending end allows for greater throughput (to a point anyway). The number 5 was just an example of n where n > 1. Jon -- Posted via http://www.ruby-forum.com/.