tcpdump mailing list archives

[Fwd: Re: Thread Safe Lexer]


From: Behdad Forghani <behdad.forghani () samsarasol com>
Date: Wed, 01 Jul 2009 15:04:49 -0400

Hello,

Gianluca asked me to forward this to the mailing list. During Sharkfest09 he had mentioned that Winpcap cannot is not re-entrant and thread-safe because Lex uses global variables. As you can see, one solution to this is to use re2c for lexing and lemon for parsing. The link to re2c is:
http://re2c.org/
http://sourceforge.net/projects/re2c/

Let me know if you want me to help any further.

Best Regards,
Behdad

----- Original Message ----- From: "Behdad Forghani" <behdad.forghani () samsarasol com>
To: <gianluca.varenni () cacetech com>
Sent: Monday, June 29, 2009 12:53 PM
Subject: Thread Safe Lexer


Hi Gianluca,

As you remembered, we discussed thread safe lexer during Sharkfest. You can use flex++ to generate C++ code that is thread safe. If you want more information let me know.

Another good tool to make thread safe lexers is re2c.

Using flex++ is probably a no/no, since it generates C++, and libpcap is strictly C code.
How many changes would be needed to use re2c instead of flex/bison?

Also, I think it would be great to move this discussion to the tcpdump-workers mailing list, where all the libpcap folks hang out.

Have a nice day
GV


I had wrongly mentioned lemon, lemon generates thread safe parser and not lexer.

Let me know if you need any help.

Regards,
Behdad


-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: