Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

lazy evaluation with autoload vs require in ruby ?

With my code I'm using autoload for lazy evaluation so I can load the program faster and load the files when needed, I'm not seeing so many people using it, but with Thin project I noticed autoload has been used widely, anyways just wanna know if there is any risk to use it .

like image 578
Eki Eqbal Avatar asked Dec 23 '11 14:12

Eki Eqbal


1 Answers

autoload is not threadsafe and will be deprecated in the future versions of Ruby. Here is the proof by Matz (creator of ruby).

like image 106
Aliaksei Kliuchnikau Avatar answered Sep 28 '22 15:09

Aliaksei Kliuchnikau