This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Is GSL Thread Safe?


On Mon, Apr 01, 2002 at 03:31:30PM -0500, banerjee@wernicke.ccn.upenn.edu sent those random bytes:
> Folks,
> 
> I searched through the GSL manual and found no occurrences of "thread." I 
> conclude then, that GSL is not thread safe. Is this correct? If so, 
> what would it require to make GSL trhead safe and has anyone worked in 
> that direction?

I found the lines I was searching for:
gsl-1.1.1/doc/gsl-design.texi

@node Thread-safety, Legal issues, Compilation, Design
@section Thread-safety

The library should be usable in thread-safe programs.  All the functions
should be thread-safe, in the sense that they shouldn't use static
variables.

We don't require everything to be completely thread safe, but anything
that isn't should be obvious.  For example, some global variables are
used to control the overall behavior of the library (range-checking
on/off, function to call on fatal error, etc).  Since these are accessed
directly by the user it is obvious to the multi-threaded programmer that
they shouldn't be modified by different threads.

There is no need to provide any explicit support for threads
(e.g. locking mechanisms etc), just to avoid anything which would make
it impossible for someone to call a GSL routine from a multithreaded
program.

-- 
Carlo Perassi
http://www.linux.it/~carlo/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]