What about a hash of global locks keyed on file name? Or would that be too expensive? Sent from my iPhone On Nov 11, 2008, at 7:40 PM, Charles Oliver Nutter <charles.nutter / sun.com > wrote: > Dave Thomas wrote: >> It would seem that many of the global $ variables would need >> protecting from concurrent access from multiple threads. So, >> wouldn't it solve the problem simply to have a mutex (or set of >> mutexes) to controll access to these, and then claim the mutex >> associated with $" while doing the require? > > A single global lock would avoid deadlock...but would also prevent > any other threads from running while a require was in process. That > may or may not be acceptable; but I don't think we should prevent > independent threads from requiring *different* files at the same > time in any case. > > - Charlie >