
On 21/09/2016 11:28, Enea Zaffanella wrote:
Hello.
In the past weeks I worked on the inclusion of experimental thread-safety support (mostly based on the work by Maxim Gaina) in the "devel" branch of the Parma Polyhedra Library.
A few relevant information:
- as said above, thread-safety support is only available in the git
branch named "devel"
- in order to enable support for thread-safety, the library has to be
configured using option "--enable-thread-safe"
- it assumes a compiler supporting C++11 threads (tested only with gcc
on linux)
- currently thread-safety is only available when using the C++, C and
Java language interfaces
the timeout mechanism does NOT support thread safety (yet)
a few examples of computations using multiple PPL threads can be
found in: * demos/ppl_lcdd (for the C++ interface) * demos/ppl_lpsol (for the C interface) * interfaces/Java/tests/Variable_Output_thread_safe1.java
- it is worth stressing (again) that the library is *conditionally*
thread safe: if any two application threads share library objects, the application should manage to properly serialize all accesses to these objects (note: even when all these accesses are meant to be read-only, because many PPL operators are "logically const", but may actually modify the internal representation of objects, therefore leading to race conditions)
- beware of inefficiencies coming from memory allocation; we suggest
to replace the standard allocation mechanism with something that behaves better in a multi-threaded setting (e.g., TCMalloc).
It would be nice if people interested in this extension could give it a try and provide us with some feedback.
Enea.
I am quite interested. I hope to make some experiments using the Java interface as soon as possible.
--gianluca amato