Roger Pack wrote: >> I've given this a lot of thought, and I'm just about positive the best you >> can do is return immediately if another thread has *started* requiring a >> given file. There's no safe way to ensure it has *completed*. Ultimately I >> think the more important guarantee is that require cause a file to start >> loading *exactly once*. >> >> Moral of the story: don't require the same file across threads. > > A safe way would probably be to raise if a file is required twice > synchronously--then the user can at least know what's going on and be > forced to accomodate wisely for their threadedness, while also > disallowing deadlocks. > Thoughts? Not a bad idea, but then again I'm generally in favor of smacking users around rather than trying to fake behavior badly. Others will disagree, but an error sounds great to me. If something like it had existed previously it would have saved us some unusual bugs. - Charlie