in reply to Re^10: how to split huge file reading into multiple threads
in thread how to split huge file reading into multiple threads
That is not how I see it being done, and you clearly misunderstand what the pipes are doing, and as usual you use incorrect math to make the problem seem worse, somehow hoping it will prove your point. Not today, my man.
First there would only be 10 pipes, if there were 10 threads. The main thread can open as many disk files as it wants, and as the data comes into the select loop, some logic can be applied to determine which of his 600 output files it gets written to. The select loop would act as a central collection point/filter, allowing one piece of logic to decide where any thread output should be ultimately be written.
Its simple: the threads write to the select loop, the select loop decides where the particular data should be written. Otherwise he would need to incorporate the logic for which file to output to, into each thread, AND THEN have to worry about flocking those files. My method avoids that flocking problem by making the select loop the master disk writer and filter.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^12: how to split huge file reading into multiple threads
by BrowserUk (Patriarch) on Sep 02, 2011 at 16:32 UTC | |
by zentara (Cardinal) on Sep 02, 2011 at 16:40 UTC |