[gdal-dev] RE: Thread Synchronization in 1.5.0?
Martin Chapman
mchapman at texelinc.com
Fri Feb 8 16:12:17 EST 2008
Frank,
Just as an FYI, I noticed that the Win32 function CreateThread() is used on
line 610 of file C:\software\GDAL\port\cpl_multiproc.cpp. This function may
not be the best for creating a thread on windows. _beginthreadex() is the
preferred way to invoke threads in C on windows because it copies all global
variables in the Win32 API into the thread local storage for each thread
making the Win32 API usage thread safe, where the older C style
CreateThread() function does not. This may or may not be an issue for gdal
depending on what other Win32 API calls are made from within gdal on
windows.
Please advise me if anyone thinks this is incorrect.
Best regards,
Martin Chapman
-----Original Message-----
From: Frank Warmerdam [mailto:warmerdam at pobox.com]
Sent: Friday, February 08, 2008 2:05 PM
To: Martin Chapman
Cc: gdal-dev at lists.osgeo.org
Subject: Re: Thread Synchronization in 1.5.0?
Martin Chapman wrote:
> Frank,
>
>
>
> I see a lot of thread synchronization code in 1.5.0 but not everywhere.
> Does this mean that some of GDAL is currently thread safe and other
> parts are not, or is the whole library considered safe at this point?
> Is there any public documentation on this new behavior?
Martin,
The response in the FAQ:
http://trac.osgeo.org/gdal/wiki/FAQMiscellaneous
is still essentially accurate. We can safely read via multiple threads
from some drivers. Writing is not thread safe. Many drivers have not
been reviewed and are at users-own-risk.
But I think things have improved since 1.3.0 in that some thread
related bugs have been fixed and there are more safe drivers.
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 OSGeo, http://osgeo.org
More information about the gdal-dev
mailing list