Always use std::mutex for locking, never a custom spin lock

Authored by mwolff on Apr 24 2018, 9:03 PM.

Description

Always use std::mutex for locking, never a custom spin lock

The previous change which introduces a custom buffered write
now often leads to abysmal performance of heaptrack under extreme
thread pressure. E.g. running heaptrack tests/manual/threaded
suddenly takes up to one minute instead of around one second.

By using a mutex always, the performance is back in the original
ballpark. We can workaround the deadlock that was originally observed
by using std::mutex::try_lock for the background timer thread,
to ensure it's not endlessly locking while we try to join it during
destruction.

Details

Committed
mwolffApr 27 2018, 11:18 AM
Parents
R45:95a17c6a407a: Do not use stdio for buffered I/O
Branches
Unknown
Tags
Unknown