[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Thred safety
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] Thred safety |
Date: |
Mon, 30 Jan 2017 20:53:58 +0300 |
> > I replaced all calls to gmtime, strerror, and strtok with corresponding
> > calls to wrappers xgmtime, xstrerr, and xstrtok (see env/stdc.c).
> >
> > At the moment the wrappers just call corresponding standard functions.
> > Any idea how to better implement them?
>
> Until you have something better,
> sandwich the calls and the data-copying between a mutex lock and unlock.
> With threads, I expect implementation-dependent stuff.
> I expect it can be placed in a header file.
>
I implemented the wrappers using thread-safe functions (i.e. gmtime_r,
strerror_r, and strtok_r) and thread local storage objects to store
static data. Please see
http://lists.gnu.org/archive/html/help-glpk/2017-01/msg00138.html .
Andrew Makhorin