quetz-mod_python-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gregory (Grisha) Trubetskoy" <gri...@apache.org>
Subject Re: Thread-safe lexer
Date Fri, 23 May 2003 17:35:40 GMT

It looks like flex 2.5.31 (which is newer than 2.5.4 - go figure) supports
generation of reentrant scanners without C++, and after a couple of hours
of butchering Sterling's code I've been able to get it to work just now.

Since we are distributing the flex-generated psp_parser.c anyway, users
don't need to even have flex on their systems to compile mod_python, so a
requirement for flex 2.5.31 doesn't seem like a huge problem.

The problem may be that flex 2.5.31 is still buggy, but at this point I
haven't seen any bugs.

I need to do some cleaning up of this code, then I'll check those changes
in.

Grisha

On Fri, 23 May 2003, Jack Diederich wrote:

>
> ----- Original Message -----
> From: "Gregory (Grisha) Trubetskoy" <grisha@apache.org>
> > I also googled for an example of a thread-safe use of flex, but couldn't
> > find much other than c++ examples... Still I feel this wheel has got to
> > have been invented already...
>
> Here is one suggestion, use perl/awk to munge the output of
> flex and change the globals to instead access a struct.
> http://compilers.iecc.com/comparch/article/01-04-050
>
> As a quick & dirty solution that will be fine for 99% of
> users, a mutex around the parsing code will work.
> Only one process could flex at a time but since each file
> will only be flexed once this is livable.  On machines with
> a low number of CPUs (two or certainly one) it wouldn't
> even be noticable.
>
> For industrial (mass hosting) companies the apache processes
> are long lived so they won't be processing templates for the
> vast majority of their life spans, just accessing the cached
> version.
>
> Either way, I wouldn't sweat the quick & easy way until
> someone can show real numbers where it is more than twice
> as slow (in latency, it will always be the same in CPU) regularly.
>
> -jackdied
> --
> _______________________________________________
> Sign-up for your own FREE Personalized E-mail at Mail.com
> http://www.mail.com/?sr=signup
>


Mime
View raw message