From: Dave Thomas Date: 2006-01-17T11:02:27+09:00 Subject: Re: There's a deadlock in code in the PickAxe, and I'm not seeing why: On Jan 16, 2006, at 4:41 PM, ara.t.howard@noaa.gov wrote: > >> The following code (form pg. 739) deadlocks with a large count. >> What am I missing? > > works for me on mac and linux. what are you on? OSX/ruby 1.8.2 (2004-12-30) [powerpc-darwin8.2.0] dave[CVS/rubybook 19:52:46] ruby t.rb deadlock 0x3a4e40: sleep:J(0x3b090c) - /Users/dave/ruby1.8/lib/ruby/ 1.8/thwait.rb:121 deadlock 0x3b090c: sleep:- - /Users/dave/ruby1.8/lib/ruby/1.8/ sync.rb:150 ... deadlock 0x1b4af4: sleep:- - /Users/dave/ruby1.8/lib/ruby/1.8/ sync.rb:150 deadlock 0x1d5790: sleep:- (main) - /Users/dave/ruby1.8/lib/ruby/1.8/ thread.rb:281 /Users/dave/ruby1.8/lib/ruby/1.8/thwait.rb:119:in `pop': Thread (0x3ca744): deadlock (fatal) from /Users/dave/ruby1.8/lib/ruby/1.8/thwait.rb:139:in `next_wait' from /Users/dave/ruby1.8/lib/ruby/1.8/thwait.rb:154:in `all_waits' from t.rb:35 It doesn't always do it, but with 100,000 iterations, it does it most of the time. Interestingly, it doesn't seem to do it with the precompiled Ruby. I'm wondering if I build my local version with the wrong threading options: the Apple build has --enable-pthread, and mine doesn't Anyone know if that would cause a problem? Dave