[webkit-dev] Re: [webkit-changes] cvs commit: JavaScriptCore/pcre pcre.h pcre_compile.c pcre_exec.c

Maciej Stachowiak mjs at apple.com
Sat Jan 7 20:50:16 PST 2006


On Jan 6, 2006, at 5:28 PM, Darin Adler wrote:

>
> These calls are thread-safe on both Mac OS X and Windows -- both  
> those platforms use per-thread globals for these calls.
>
> On Mac OS X, we also have the _r variants, but they are no more or  
> less thread-safe (although it's more elegant to not use the  
> globals). If there's an important platform that has the _r variants  
> but a non-thread-safe localtime and gmtime we can add conditionally  
> compiled code since Windows does not have the _r variants.

These aren't threadsafe on Linux (Maks checked the glibc source  
code). And the _r variants are easy to implement in terms of the  
windows _s variants (or even in terms of the vanilla variants, given  
that they are threadsafe) on Windows. Looking at the OS X  
implementation the _r versions also look more efficient, though  
probably not enough to matter in the real world.

Regards,
Maciej




More information about the webkit-dev mailing list