Jerasure icon indicating copy to clipboard operation
Jerasure copied to clipboard

Thread safety issues

Open dmitrysobinov opened this issue 9 years ago • 1 comments

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?

dmitrysobinov avatar Oct 19 '15 01:10 dmitrysobinov

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.

tsuraan avatar Oct 27 '15 18:10 tsuraan