[ragel-users] union operator and thread-local variables

Adrian Thurston adrian.thurston at esentire.com
Wed Oct 28 17:20:59 UTC 2009


I would make

mon1 = ...
mon2 = ...
mon3 = ...
.
.
.

For all the possibly interfering invocations you need.

> That's why I thought about thread-local variables.  If we have local  
> error actions can't we export some local context?

Ragel builds DFAs from the grammar, so the 'threads' are switched 
between at each character. Any kind of local context switch that occurs 
on each state change would be way too costly. Better to try to parse 
pattern one, stop, rewind, try pattern two, and so on or to make the 
'threads' use different data.




More information about the ragel-users mailing list