Re: [PATCH] strtod.3: ATTRIBUTES: Note functions that are thread safe with exceptions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Haitao,

On Wed, Jan 22, 2014 at 9:57 AM, Peng Haitao <penght@xxxxxxxxxxxxxx> wrote:
>
> On 01/22/2014 04:29 PM, Andre Majorel wrote:
>>>> If that is the case, how about :
>>>>
>>>>   These functions can be safely used in multithreaded
>>>>   applications, as long as the locale is not changed during
>>>>   their execution.
>>>
>>> The above sentence is OK, but I think added setlocale(3) is
>>> better, thanks.
>>>
>>> These functions can be safely used in multithreaded
>>> applications, as long as setlocale(3) is not called
>>> to change the locale during their execution.
>>
>> This wording can be interpreted to mean that calling setlocale()
>> *is* permitted as long as the locale doesn't change. If that is
>> really what you mean, then no further objections from me.
>
> That is what I mean.

Can I just confirm what I understand from this conversation:

* A call to strtod() is thread-safe so long as no other thread uses
setlocale() to change the locale *during* the execution of strtod().
* If a call to setlocale() changes the locale *before* a call to
strtod(), then the call to strtod() is still thread safe.

Correct?

Thanks,

Michael


> --
> Best Regards,
> Peng
>
>> Otherwise, my recommendation would be
>>
>>   These functions can be safely used in multithreaded
>>   applications, as long as setlocale() is not called during
>>   their execution.
>>
>



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux