This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigCA81980F28569100FE11E1C4
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,

(2011/11/19 17:17), Yehuda Katz wrote:
>> I think it is still possible to make require itself threadsafe,
>> if
> we use a
>> single lock for requires, as Charlie Nutter has previously
>> proposed.
>=20
> I don't know that single lock solution is acceptable, because the=20
> cross-require issue is caused by developer's error we think, and=20
> should be easily avoidable (Just don't do!)  It would be too big=20
> restriction to save this error.
>=20
> The few cases I have personally discovered in Rails were complex
> cases that weren't obvious at first glance. When a lot of code is
> involved in the autoload process, it's very easy for some
> cross-require cases to exist (usually through intermediate code).

Would you please collect and show us a concrete example of that
problem?  I can imagine artificial cases but we should make sure we
are solving the same problem.  (This discussion started from
'autoload' which is not related!)

Besides this, I discussed it with Matz again, and he seems to like the
single lock idea, unless it doesn't hurt anything I guess.  I still am
thinking that serializing all 'require' and 'load' could cause a few
(rare?) problem for existing lib/app, but I don't have any concrete
example, so let's implement and evaluate it first.

> In my mind, making threadsafety guarantees about require, even if
> they come with some caveats, is far better than simply warning
> developers not to do "the wrong thing" in their apps or libraries
> in the case where code is being loaded lazily in the presence of
> threads.

Somewhat agreed, but I want to see examples.  For me, loading code
lazily itself looks 'the wrong thing', too. :)

// NaHi


--------------enigCA81980F28569100FE11E1C4
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)

iQEcBAEBAgAGBQJOx5xBAAoJEC7N6P3yLbI2RAwH/R6fLwIbC5fLKOPH9vuZha52
wEsBhvY9ILtPILc0PNnIuUU2mj+NqshB0RcvPWfxKhox5MG7bg0iKieh8a9rfN0n
+DCy8NQHqmnYbECYSMiP3ti5lF7cCpYtsC6rj0QvPWZrgIxt7d+kHw0C1Ab5uiFD
jYpQ6bD8G7qAcmN4gZtJ/vDPQ4sKMYMZLbNOh58JXfOT3KmN5spNdzbyReyBZU8j
7gZRRnbT6H/sipQ9LmNKGzIbMVgvAiXy8iKwAKh7jlH8CfVdrD3XGA8wraUnAoIv
7s3FjO8Nt4ls+WixlYK+r0wO3zX98mNtxPWBLun6NM5vIqlKy2vidzt7ForUgfE=
=P3jO
-----END PGP SIGNATURE-----

--------------enigCA81980F28569100FE11E1C4--