From: Matt Armstrong Date: 2002-04-01T07:53:45+09:00 Subject: Re: Multithreaded socket code. Request for Comments "Robert C. Martin" writes: > @lock.synchronize {@threads << Thread.current} > @lock.synchronize {@threads.delete(Thread.current)} > @lock.synchronize {threads = @threads.dup} I don't think you need to synchronize these operations. For the first two, the value returned by Thread.current won't become invalid no matter what other threads do. And I am 90% sure that Array.delete, Array.<< and Array.dup are all atomic in Ruby's thread model. -- matt