Hi Andrew,
> As Heinrich noticed, gmtime, strerror, and strtok are non-thread-safe
Checking the online MSDN documentation, I see that strtok is also safe
on Windows for multiple threads, but It isn't clear what happens for
strerror - it is implied that a pointer to a fixed string is returned
but
On 01/29/2017 06:22 PM, Andrew Makhorin wrote:
> Hi Chris,
>
>>> Not sure, but gmtime_s looks like a MSVC function. Could you point me
>>> out where gmtime_s is standardized? Thanks.
>>
>> gmtime_s is included in the (optional) annex K of C11. However, the
>> parameters are reversed compared to th
Hi Chris,
> > Not sure, but gmtime_s looks like a MSVC function. Could you point me
> > out where gmtime_s is standardized? Thanks.
>
> gmtime_s is included in the (optional) annex K of C11. However, the
> parameters are reversed compared to the MSVC version and the standard
> one returns struct
Hi Heinrich,
> > If a multithreaded application calls the same GLPK library function in
> > two threads at the same time, unexpected results may occur.
> >
> > Gmtime, strerror and strtok use one global buffer each for all
> > threads.
> >
> > They do not use thread local memory.
> >
>
> Proba
> If a multithreaded application calls the same GLPK library function in
> two threads at the same time, unexpected results may occur.
>
> Gmtime, strerror and strtok use one global buffer each for all
> threads.
>
> They do not use thread local memory.
>
Probably you are right. (At least glib
If a multithreaded application calls the same GLPK library function in two threads at the same time, unexpected results may occur.
Gmtime, strerror and strtok use one global buffer each for all threads.
They do not use thread local memory.
On 1/29/17, 09:35 Andrew Makhorin wrote:
> Here
> Here is a list of functions that are not thread safe under POSIX 2008:
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_09_01
>
> Problematic coding includes:
> strtok used in mplsql.c
> gmtime used in time.c
> strerror used in stream.c, gzguts.h, mpl6.c, glprpr.