[ragel-users] Ragel Ruby generated code uses singleton class so it's not thread safe [INVALID]

Iñaki Baz Castillo ibc at aliax.net
Wed Feb 4 21:18:49 UTC 2009


El Miércoles, 4 de Febrero de 2009, Iñaki Baz Castillo escribió:

> So I wonder how could I use this class into a threaded program. A Ruby
> singleton class is the Class itself, so if a running thread modifies
> some Class attribute then all the other threads will see that change
> (error!!!).

After asking it in Ruby-Talk maillist I've received a very good explanation:
Singleton variable are read-only. The only writtable variable are local 
variables into Singleton methods.

So all is Ok :)

Thanks a lot and sorry for a bad bug report.

-- 
Iñaki Baz Castillo




More information about the ragel-users mailing list