From: ajay paswan Date: 2012-11-26T20:35:21+09:00 Subject: Re: atomic statements in multithreading Arlen Cuss wrote in post #1086450: > That is not what "atomic" would usually mean; what you're asking for is > a mix of many other concepts. Thread.exclusive may be want you want: > > step-1 > Thread.exclusive do > step-2 > step-3 > end > step-4 > step-5 > > But it's loaded with gotchas and you may want to be more explicit; or > indeed, work out a way to not need this synchronisation between threads. Does it do the same as: ?? Thread.list.each do |t| if t!=Thread.current t.stop end end step-2 step-3 Thread.list.each do |t| if t!=Thread.current t.run end end -- Posted via http://www.ruby-forum.com/.