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