From: "Iñaki Baz Castillo" Date: 2009-02-05T06:16:22+09:00 Subject: Re: Using a Class (not an instance) into threads El Miércoles, 4 de Febrero de 2009, Robert Klemme escribió: > 2009/2/4 Iñaki Baz Castillo : > > El Miércoles, 4 de Febrero de 2009, Robert Klemme escribió: > >> I do not know Ragel but it may well be that the class that Ragel > >> created has only immutable state necessary for the parser and that the > >> parsing related state is in instances of that class. Can you post > >> more of MyParser? > > > > There is no usage of class instances, but just class methods and class > > attributes. > > > > I attatch a Ragel generated Ruby parser (it's just a few extract of a SIP > > parser I'm building). > > Note that the Ragel generated code is from line 11 up to line 170. > > I did not look too closely but it seems that the shared state is used > read only. You can easily verify yourself by simply freezing it and > see whether you get errors from that. You are right! The only writtable variables are local variables inside class methods! Really thanks a lot for pointing it out :) -- Iñaki Baz Castillo