Charles Oliver Nutter wrote:
> Roger Pack wrote:
>>> Currently with 1.8.7 (for me) the secondmost thread continues
>>> immediately [with false returned] and with 1.9 the second thread
>>> blocks then loads the required file a second time. Are these
>>> expected?
>>
>> Thanks for fixing that in 1.9 trunk.  [now if two threads request the
>> same file the second blocks till the first "finishes"]
> 
> Is this behavior now specified? I don't remember this ever being resolved.

Yeah, I don't think this is a good solution. Remember the deadlock case:

first.rb

require 'second'

second.rb

require 'first'

Two threads requiring the separate files at the same time will deadlock. 
Of course this is contrived, but there are circular requires fairly 
often in applications.

- Charlie