Skip to content

Multi-threading #26

@JoergRambau

Description

@JoergRambau

Dear qsopt_ex team,

I am Jörg Rambau from the university of Bayreuth. I am writing this as the author of TOPCOM. I have successfully built an interface to qsopt_ex for regularity checks of triangulations of point configurations, usable as an alternative to cddlib (Fukuda). However, using separate instances of the exact solver in multiple threads crashes the program in random places. It seems at first sight that the gmp memory management is global in qsopt_ex and not thread-safe.

My question is: is qsopt_ex expected to be thread-safe and I have made a mistake somewhere, or is it clear that several instances of the exact solver running in parallel threads will not work?

For my purpose, it would be the best if I could enforce the call of completely separate instances of the exact solver running lock-free, e.g., by thread-local storage for the global data. I have experimented with this myself, but it seems that "__thread", while making builtin types like "int" thread-local, fails to make mpq-structures from gmp thread-local. I also tried to compile qsopt_ex with c++ using "thread_local", but all the untyped preprocessor magic does not go through in c++.

I am developing mostly in Apple clang version 11.0.3 (clang-1103.0.32.59) and in various versions of gcc on ubuntu Linux, standard c++11.

Thanks a lot for clarifying!
Jörg

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions