help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] Fwd: Re: Determining if the GLPK library is compiled to be r


From: Heinrich Schuchardt
Subject: [Help-glpk] Fwd: Re: Determining if the GLPK library is compiled to be reentrant.
Date: Sat, 14 Jan 2017 14:34:23 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0

Hello Andrew,

I guess the best solution will be to return the empty string "" when an
option is not set and NULL if the option does not exist.

Then we can use

const char *ret = get_config("TLS");
if (!ret || !*ret) {
        fprintf(stderr, "TLS not supported");
        pthread_exit(NULL);
}

Best regards

Heinrich Schuchardt


-------- Forwarded Message --------
Subject: Re: [Help-glpk] Determining if the GLPK library is compiled to
be reentrant.
Date: Sat, 14 Jan 2017 10:25:25 +0100
From: Heinrich Schuchardt <address@hidden>
To: Andrew Makhorin <address@hidden>
CC: address@hidden <address@hidden>

Hello Andrew,

I understand that you do not want to create env before checking if TLS
is configured. But, please, do not call abort() in glp_config().

Otherwise your abort statement will stop the complete application.
Imagine that being the webserver for a site on which a webapp is
deployed which calls the GLPK library.

Either simply return NULL. Or define a value with signifies an error:

glpk.h:
#define GLP_INVALID ((const void *) -1)

env/env.c:
const char *glp_config(const char *option)
{
...
   return GLP_INVALID;
...
}

Best regards

Heinrich Schuchardt

On 01/14/2017 03:27 AM, Andrew Makhorin wrote:
>> a program that uses a GLPK library which is not compiled with thread
>> local storage may fail fatally when run with multiple threads.
>>
>> I hence suggest to add a function that allows to determine if GLPK was
>> compiled to be reentrant. We could use the same function to return other
>> features too.
> 
> Done. Please see an updated version of glpk here:
> http://sourceforge.net/projects/noumenon/files/tmp/
> (Note that this is *not* an official release.)
> 
> I added API routine glp_config (see it in src/env/env.c) which provides
> necessary functionality.
> 
> 
> Andrew Makhorin
> 
> 


_______________________________________________
Help-glpk mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-glpk




reply via email to

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