开发者

flex/lex yacc/bison multithreaded environment

开发者 https://www.devze.com 2022-12-10 02:16 出处:网络
Can I use the code generated by flex/bison|lex/yacc in a multithreaded environment ? I\'m afraid开发者_高级运维 there are a lot of global variables. How can it be fixed ?With flex you can use %option

Can I use the code generated by flex/bison|lex/yacc in a multithreaded environment ? I'm afraid开发者_高级运维 there are a lot of global variables. How can it be fixed ?


With flex you can use %option reentrant and with bison %pure-parser to generate re-entrant code that does not have global data. You may still need some sort of synchronization to prevent multiple threads using the same data blocks at the same time.

0

精彩评论

暂无评论...
验证码 换一张
取 消