help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Thread Safety of GLPK


From: Simone Atzeni
Subject: Re: [Help-glpk] Thread Safety of GLPK
Date: Tue, 29 Aug 2017 21:51:06 -0600

Hi all,

thanks for your answers.
I updated to version 4.63, but I keep getting errors such as "segmentation 
fault" or "glp_free: memory allocation error”.

I have a function, with a few parameters in input, which creates the MIP and 
solve it (attached the function which creates the MIP).
This function is called by multiple threads with different parameters and they 
do not share any data.
As soon as I call the function within a mutex lock/unlock everything works fine.

I compiled the GLPK package with Clang/LLVM 4.9 which has support for TLS, so I 
think everything should be fine.
Do I need to do something else to make GLPK thread safe?

Thanks.
Best,
Simone

Attachment: problem.txt
Description: Text document

> On Aug 25, 2017, at 01:13, Andrew Makhorin <address@hidden> wrote:
> 
> 
>> In the GLPK documentation, paragraph "2.1.3 Thread Safety" states:
>> 
>> 
>> "The standard version of GLPK API is not thread safe and therefore
>> should not be used in multi-threaded programs.”
> 
> The *standard* (i.e. ANSI C89) version is not thread safe. However,
> starting from 4.61 (released on Jan 2017) glpk can be used in
> multi-threaded programs on some platforms (including GNU/Linux and MS
> Windows); for more details please see:
> https://lists.gnu.org/archive/html/help-glpk/2017-01/msg00111.html .
> (It's better to use the most recent version, which is 4.63.)


reply via email to

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