--bcaec548a8f3848c2104b25b9452
Content-Type: text/plain; charset=ISO-8859-1

It is common to use autoload to register a number of incompatible options.
For instance, Rack registers all possible server adapters, and loading the
adapters has side-effects.

I looked into this when I worked on Rails threadsafetiness and it is simply
incorrect to preload anything registered as an autoload.

Yehuda Katz
(ph) 718.877.1325


On Tue, Nov 22, 2011 at 3:51 PM, Eric Wong <normalperson / yhbt.net> wrote:

> Yukihiro Matsumoto <matz / ruby-lang.org> wrote:
> > Today, I talked with NaHi about enhancing const_missing to enable
> > autoload-like feature with nested modules.  But autoload itself has
> > fundamental flaw under multi-thread environment.  I should have remove
> > autoload when I added threads to the language (threads came a few
> > months after autoload).
>
> Hi, many of my Ruby scripts/apps are single-threaded and I would
> like to keep memory usage down.
>
> How about keeping autoload unchanged for single-threaded use and have
> modules registered via autoload instantly require everything registered
> when Thread.new is called?
>
>

--bcaec548a8f3848c2104b25b9452
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

It is common to use autoload to register a number of incompatible options. For instance, Rack registers all possible server adapters, and loading the adapters has side-effects.<div><br></div><div>I looked into this when I worked on Rails threadsafetiness and it is simply incorrect to preload anything registered as an autoload.<br>

<div><br clear="all">Yehuda Katz<br>(ph) 718.877.1325<br>
<br><br><div class="gmail_quote">On Tue, Nov 22, 2011 at 3:51 PM, Eric Wong <span dir="ltr">&lt;normalperson / yhbt.net&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">Yukihiro Matsumoto &lt;matz / ruby-lang.org&gt; wrote:<br>
&gt; Today, I talked with NaHi about enhancing const_missing to enable<br>
&gt; autoload-like feature with nested modules.     &gt; fundamental flaw under multi-thread environment.     
&gt; autoload when I added threads to the language (threads came a few<br>
&gt; months after autoload).<br>
<br>
</div>Hi, many of my Ruby scripts/apps are single-threaded and I would<br>
like to keep memory usage down.<br>
<br>
How about keeping autoload unchanged for single-threaded use and have<br>
modules registered via autoload instantly require everything registered<br>
when Thread.new is called?<br>
<br>
</blockquote></div><br></div></div>

--bcaec548a8f3848c2104b25b9452--