I've got a question about require thread safety: should we try to enforce it?

For example, if two scripts try to require the same file at once, should we:

1. do what we do now, and potentially they both execute the file
2. synchronize against the list of loaded features, such that they may both search for the library but only one will load it; however, this won't guarantee the library has been *completely* loaded 3. synchronize against both the list of loaded features and any features still in the process of loading; this guarantees that require will never re-load a script and will not return until any other requires on other threads have completed; but it may lead to deadlocks if two threads attempt to load the same two libraries in different orders.

At the moment I'm leaning toward improving the situation at least to (2) above, but not doing (3) because MRI makes no such guarantees and the deadlock potential is too high. Am I right about that? Other thoughts?

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to