Thread Safety #650
Labels
✨ feature
New operation or other feature
help wanted
Extra attention is needed
🎓 student programmer
Work, work...
🎓 student project
Work, work... but academic!
Milestone
In many contexts, BDD packages should be threadsafe such that they can be used as part of parallel algorithms. It is not possible for such a program to know early how many threads may exist before it starts its calculations. Hence, Adiar has to adapt on-the-fly to the number of concurrent calls.
Luckily for us, the write-once/read-only design of Adiar's files makes thread-safety much easier (since we have no unique node table to lock). Yet, instead we have one global pool of M memory in TPIE that we are allowed to use. Hence, we need some kind of locking/scheduler to make sure every thread can claim a share of M "early". Otherwise, another thread can by accident overtake it and both ask TPIE for the same "free" memory.
ADIAR_THREADSAFE
to CMake (default: OFF). If on, then the logic for thread-safety below is included.memory_share
class that uses RAII to claim a share of memory.The text was updated successfully, but these errors were encountered: