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?
>
>