Re: Thred safety

"Heinrich Schuchardt" <[email protected]>
Newsgroups gmane.comp.gnu.glpk
Message-ID <trinity-c6c4b73b-f668-4e57-9e18-8a0c8f7e39c8-1485679907675@msvc-mesg-gmx101>
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 <[email protected]> wrote:

> 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.c

>

> I wonder if dlsup.c is thread safe.

I consulted the ISO C11 Standard and think that there should be no

problem with all these functions under conforming implementation,

because no glpk routines share data between threads.

Andrew Makhorin

_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.