[Top][All Lists]

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

Re: [Help-glpk] GLPK re-endrant

From: Antonello Lobianco
Subject: Re: [Help-glpk] GLPK re-endrant
Date: Tue, 30 Jun 2009 13:02:14 +0200

In my case I have a C++ program (an agent-based model) that instances
many objects (agents). Each istance owns its own small glpk problem
and solve it independently from the other instances (in a per-agent

So in my case, reentrant would make a huge difference ;-)

So.. is it enought to do a "search and replace" for strerror and
strtok on the src tarball and add the __thread attribute on the tls
pointer (file glplib02.c) before configure/compiling on a i386 {Linux
box && MinGW} to have glpk reentrant ?

That would be great!


On Mon, Jun 29, 2009 at 9:06 PM, Andrew Makhorin <address@hidden> wrote:

> No, currently glpk is not reentrant. It uses standard C functions
> strerror and strtok, which are non-reentrant. In principle, it would
> be possible to replace them with strerror_r and strtok_r as well as
> add the attribute '__thread' to the 'tls' pointer when such features
> are supported by a particular platform (I mean configure script).
> However, I see no gain, because even if glpk were reentrant, the
> application program could not use the same instance of glpk program
> objects (like glp_prob) from different threads. On the other hand,
> if it calls glpk routines only from one thread, reenterability is not
> needed.
> Andrew Makhorin

Antonello Lobianco
antonello a.t

reply via email to

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