quetz-mod_python-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Diederich" <jack_dieder...@email.com>
Subject Re: Thread-safe lexer
Date Fri, 23 May 2003 13:29:25 GMT

----- 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