help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Thred safety


From: Heinrich Schuchardt
Subject: Re: [Help-glpk] Thred safety
Date: Sun, 29 Jan 2017 09:51:47 +0100

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 <address@hidden> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]