From: Brent Roman Date: 2008-12-04T06:58:54+09:00 Subject: [ruby-core:20274] Re: autoload and concurrency Yes, I'd forgotten for a moment about the deadlock issue. Thanks for reminding me. One way to avoid the deadlocks might be to dedicate a thread to servicing all requests to load new code. Require and constant resolution with "autoload" enabled would be redefined to queue code load requests. The code "loader" thread would remove such requests from the queue, then load the required ruby files (including other files required by the requested file) while the requesting thread waited remained blocked. The loader thread would release the requesting thread only after its require request had been satisfied. This single code loader thread thus serializes the otherwise ill behaved concurrent Ruby code loading. There are some details I'm (knowingly) omitting. Does anyone see any truck sized holes in this general idea? - brent Jim Weirich-2 wrote: > > > How do you prevent deadlocks? > > -- > -- Jim Weirich > -- jim.weirich@gmail.com > > > > -- View this message in context: http://www.nabble.com/-ruby-core%3A20235--autoload-and-concurrency-tp20806574p20822636.html Sent from the ruby-core mailing list archive at Nabble.com.