From: Ken Bloom Date: 2009-01-13T14:10:17+09:00 Subject: Re: Binding.of_caller examples don't work. On Mon, 12 Jan 2009 16:31:15 -0500, Charles Oliver Nutter wrote: >> In Ruby 1.9 pesudocode this is only slightly different: >> >> Thread.exclusive do >> [Fixnum,String].each{|klass| override_methods_on klass} >> result=builderblock.call >> [Fixnum,String].each{|klass| restore_methods_on klass} >> end > > This only guarantees only one thread can execute that block of code; it > doesn't stop other threads from running: > > ◆ ruby1.9 -e "require 'thread'; Thread.new { sleep 1; puts 'hello'; redo > }; Thread.exclusive do; sleep; end" > hello > hello > hello > hello > hello > ^C > > - Charlie Okay. In that case, I'd better read Pickaxe for 1.9 from cover to cover before I try to use 1.9. (Ducks and runs) --Ken -- Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory. Department of Computer Science. Illinois Institute of Technology. http://www.iit.edu/~kbloom1/