sosy-lab / cpu-energy-meter

A tool for measuring energy consumption of Intel CPUs
BSD 3-Clause "New" or "Revised" License
321 stars 29 forks source link

Race Condition with Measurements and Signal Handling #2

Closed PhilippWendler closed 7 years ago

PhilippWendler commented 7 years ago

A signal could interrupt the measurement code and thus the measurement is not atomic, leading to possibly slightly wrong results.

We should replace the use of a signal handler and usleep with sigtimedwait, which allows us to have a single loop that handles both the signals and the measurement.

lembergerth commented 7 years ago

Should be resolved by commit 62647c28 .