it would be nice lwes_emitter_create() was re-rentrant (since flex/bison is compiled non-re-entrant) or held a lock. lwes_emitter_create() should probably be only used once per thread. i'll get clarity into how important this is soon. thanks.
These changes change the bison parser to use the "pure parser" mode. However, there still need to be changes in order to have a reentrant flex. The most problematic part is that many systems still have flex-2.5.4 on them (RHEL5/CentOS 5 being the most common) and reentrant flex lexers were introduced after that version.
For lwes-0.23.x, I'm suggesting the following:
- add a configure.ac macro to detect flex version and add a --enable-reentrant configure flag that requires a newer flex that supports the %option reentrant string
- add respective flags in config.h, and preprocessors in the .l and .y files depending on the value of the reentrant option
Users can then choose to compile lwes using a newer flex with reentrant support, or the older flex without it.
The latest change does allow multiple parsers to be created though.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
will look into making the ESF parser re-entrant.
pthreads is not linked by design so that LWES has a minimal dependency set (for those wanting to use it in embedded applications)
Some progress has been made in revisions 101 and 110, however, it is not quite complete.
http://lwes.svn.sourceforge.net/viewvc/lwes?view=rev&revision=101
http://lwes.svn.sourceforge.net/viewvc/lwes?view=rev&revision=110
These changes are released in lwes-0.22.3.
These changes change the bison parser to use the "pure parser" mode. However, there still need to be changes in order to have a reentrant flex. The most problematic part is that many systems still have flex-2.5.4 on them (RHEL5/CentOS 5 being the most common) and reentrant flex lexers were introduced after that version.
For lwes-0.23.x, I'm suggesting the following:
- add a configure.ac macro to detect flex version and add a --enable-reentrant configure flag that requires a newer flex that supports the %option reentrant string
- add respective flags in config.h, and preprocessors in the .l and .y files depending on the value of the reentrant option
Users can then choose to compile lwes using a newer flex with reentrant support, or the older flex without it.
The latest change does allow multiple parsers to be created though.