msSetup() in mapserv.c and shp2img.c

Steve Lime Steve.Lime at DNR.STATE.MN.US
Mon Jul 9 13:24:11 EDT 2007


Is there any reason NOT to call msSetup and msCleanup though? GEOS, for example requires
the geometry factory be initialized and that (at the moment) is in msSetup. I believe Assefa ran
into that problem while extending os OGC filter support. He must be calling them somewhere.

Steve

>>> On 7/6/2007 at 5:59 PM, in message <468EC934.5020107 at mapgears.com>, Daniel
Morissette <dmorissette at MAPGEARS.COM> wrote:
> Frank,
> 
> Thanks for the quick reply. Your explanation makes sense.
> 
> Daniel
> 
> 
> 
> Frank Warmerdam wrote:
>> Daniel Morissette wrote:
>>> We have a msSetup() function in maputil.c which is used (at least by 
>>> MapScript) to initialize some resources freed later by msCleanup(). It 
>>> seems that msSetup() is not called by mapserv.c and shp2img.c?
>>>
>>> Should mapserv and shp2img not call msSetup() as well since they do 
>>> call msCleanup()?
>> 
>> Daniel,
>> 
>> As far as I can tell the initializations done in msSetup() can also be
>> adequately handled "as needed" if it isn't called.  I gather from the
>> comment:
>> 
>> ------------------------------------------------------------------------------- 
>> 
>>  msSetup()
>> 
>>  Contributed by Jerry Pisk in bug 1203.  Heads off potential race condition
>>  in initializing GD font cache with multiple threads.  Should be called 
>> from
>>  mapscript module initialization code.
>> ------------------------------------------------------------------------------- 
>> 
>> 
>> that msSetup() is primarily useful in a multi-threaded situation - getting
>> some initialization done before extra threads are split off.
>> 
>> As such, I don't see it is needed at all in shp2img or mapserv.  
>> Conversely,
>> folks shouldn't put initializations in msSetup() assuming that it will
>> actually get called.
>> 
>> Best regards,
> 



More information about the mapserver-dev mailing list