From: 7stud -- Date: 2007-10-14T12:00:34+09:00 Subject: Re: Is there a standard pattern for threaded access to a file? ara.t.howard wrote: > On Oct 13, 2007, at 11:43 AM, 7stud -- wrote: > >> >> 1) Where are you checking a return value: >> >> threads.map{|t| t.join} > > i'm not, but in a real piece of code longer than 5 lines it would be > >> >> In fact, you discard map's return value. >> >> 2) How is map's return value ever going to be different than your >> threads array? > > ah - 'join' should indeed be 'value' there. sorry. > > basically one should use Thread.current.abort_on_exception, check the > return values, or be prepared that threads may fail and you might no > know about it (which is obviously ok sometimes) > > a @ http://codeforpeople.com/ Ok, so let me get this straight: First you post a poor example that is needlessly complex for a beginner--and that won't even work in the op's situation. Then, when someone points out some flaws in your code, you claim that the proposed improvements are faulty and that your original code is superior. Finally, when someone pointedly asked how it's possible your original code does the things you claim it does, you refer to some imaginary example that you would have posted. -- Posted via http://www.ruby-forum.com/.