[Mapserver-dev] Recent progress on mapserver thread safety

Sean Gillies sgillies at frii.com
Tue Oct 12 11:08:33 EDT 2004


On Oct 12, 2004, at 7:48 AM, Frank Warmerdam wrote:

> Sean Gillies wrote:
>> 1) implement a second global parser for use in msEvalExpression
>
> Sean,
>
> My understanding (and Steve obviously knows more about this) is that 
> the
> mapfile parsing uses only the lexer while msEvalExpression() uses the
> yacc/bison parser which in turn uses the same low level lexer as the
> mapfile code uses.  It might be possible to build a seperate lexer 
> instance
> for the expressions.
>
>> and/or
>> 2) pull the parser locking out of msEvalExpression, and instead lock 
>> around
>> the loops which call msLayerNextShape.
>
> I don't think this would be all that wise. My take would be that
> mapfile parsing is pretty quick while in some cases processing shapes
> can take a long time, much of which is not spent in the parser at all.
>
>> or
>> 3) rewrite msEvalExpression so that it doesn't need a parser for 
>> logical
>> expressions.
> >
>> I'd love to get some feedback from folks who are interested in using
>> mapserver in a multithreaded environment.
>
> Well, my longer term suggestion has always been to look into whether we
> can get a thread safe lexer in place, either by researching flex 
> options
> in greater depth or if necessary by rewriting the lexer by hand.  
> Lexers
> aren't really that hard.
>

Thanks, Frank, good point on number 2, and also thanks for clarifying
my post.  I failed to distinguish between parser and lexer.

Sean

--
Sean Gillies
sgillies at frii dot com
http://users.frii.com/sgillies




More information about the mapserver-dev mailing list