Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以在多线程环境中使用 flex/bison|lex/yacc 生成的代码吗?恐怕有很多全局变量。如何解决?
使用 flex,您可以使用%option reentrant和使用 bison%pure-parser来生成没有全局数据的可重入代码。您可能仍然需要某种同步来防止多个线程同时使用相同的数据块。
%option reentrant
%pure-parser