Now the Ruby class element variables are OK?

Last May, at Railsconf in Portland, I went to a presentation where it was argued that in Rails, Ruby class member variables such as @@ foo are dangerous because they are inherently unsafe.

I researched the question later, and I never found the link that really looked for the question. I would appreciate a pointer to a good article on Rails and threads, which really goes into the question of a class member. In addition, it would be good to know how Rail 2+ and Yarv made a difference in this regard.

Edit:

My presentation memory may be vague, but I remember that @@ foo had problems that went beyond the usual warnings that should strictly control any access to the shared variable. I know that in the Ruby code itself, memory leaks were fixed, which were fixed a few back. I am looking for links to articles on common Ruby variables and multitasking, the deeper the better. * I am not currently using a class variable for anything because of this, but it would be nice to use them in certain situations.

+5
source share
2 answers

, , -, Rails, ( mongrel, , mongrel), .

, @@ Ruby 1.9, , , - .

? , , ​​ () - . ( , AR).

+1

. , , , , . @@foo , , . Rails 2+ "" , , , .

+5

All Articles