[Gdal-dev] locale handling in GDAL

Frank Warmerdam warmerdam at pobox.com
Mon Mar 6 17:32:59 EST 2006


Pete Nagy wrote:
> Eew, yuck, isn't there some way to avoid locale hacks like a sprintf
> workaround?  That kind of thing is really hard for someone new to the code
> to grok, will probably be a source of bugs as people forget to use the
> workaround, is ugly, etc.
> 
> There was some talk a while back about more multithreading improvements to
> gdal.  How about killing both birds, where the calls the program makes
> won't be sensitive to locale, and the threads that do the work will use
> c locale?  Don't know if threads can have their own locale or if there'd
> have to be interprocess stuff going on, but a multithreaded solution that
> can distribute work to processes on other machines might be the best
> anyway.  Just a thought.  Cheers,

Pete,

Well, I agree that using a custom sprintf() and atof() is going to make it
hard to use external sublibraries (ie libgeotiff, PROJ.4, etc), and will be
hard to enforce on casual contributors.

However, having all calls into GDAL turn them over to another thread to
maintain a distinct environment seems like ... overkill.  I for one, just
hate trying to debug multithreaded libraries (like the ECW library).  Such
an approach would generally complicate things.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGF, http://osgeo.org




More information about the Gdal-dev mailing list