From: nobu.nokada@... Date: 2004-03-27T04:52:24+09:00 Subject: Re: Save to use const Regexp in several threads? Hi, At Sat, 27 Mar 2004 01:44:31 +0900, Ara.T.Howard wrote in [ruby-talk:95924]: > __without__ the 'o' - i would have thought the compile once option would be > required for this since you wouldn't want all the thread re-compiling it? > > so you are saying > > pat = %r/foo/ # right > pat = %r/foo/o # wrong > > Thread.new{ pat.match s} > Thread.new{ pat.match s} No, regexp with o option will be evaluated at the written place, so the above has no multi-threaded problems. I meant: n.times { Thread.new { %r/#{yields_to(other_threads) while evaluating(long, time)}/o } } -- Nobu Nakada