Thread safety issues
dmitrysobinov opened this issue · 1 comments
dmitrysobinov commented
There are global variables in jerasure.c which are accessed without any help of atomic instructions or mutexes:
static double jerasure_total_xor_bytes = 0;
static double jerasure_total_gf_bytes = 0;
static double jerasure_total_memcpy_bytes = 0;
So if someone calls e.g. jerasure_matrix_dotprod() from two different threads in the same time, it's undefined behavior.
Maybe it makes sense to make stats collecting optional by wrapping it in #ifdef-endif?
tsuraan commented
I'll have a look at this, but most of the actual jerasure development is going on at jerasure.org; this repo is just a mirror of that. You might get more responses if you open your bug over there.