[Proj] libproj4 thread safety

Patrick Mézard pmezard at gmail.com
Sun Apr 24 10:44:25 EDT 2005

Gerald Evenden wrote:

> I am a newbie to the thread usage but I can see valid and useful 
> applications
> of threads and potential application of libproj4 as a thread entity.  
> For example,
> I currently generate my figures for the manual with two different 
> programs.  They
> could be combined into one with the graticule and coastline being 
> generated
> in parallel threads using a global projection structure.  I'm sure 
> others can
> come up with more meaningful examples.

AFAIK, Apache 2.0 is multithreaded while the Apache 1.x family uses the 
classic unix forking model. If you write a module for Apache 2.0 you'd 
better have thread-safe dependencies. There have been issues for years 
with PHP and Apache exactly for this reason, and you can still find 
advices not to run PHP with Apache 2.0 and stick with Apache 1.x. The 
problem is not with PHP anymore, it has been thread-safe for some times 
now, it is with the libraries it may depend on. So if I want to use 
libproj to design an online mapping service, I cannot use a multithread 
Well, actually I can because as I have stated in previous mails there 
are usable workarounds. However, the whole issue is very frustrating 
because libproj/proj4 are valuable libraries (that is, *stuff you cannot 
rewrite yourself*), are free, and are *almost* thread-safe (proj4 
gridding features aside for the moment).

Patrick Mézard

More information about the Proj mailing list