Skip to content

Thread safety issues #17

@dmitrysobinov

Description

@dmitrysobinov

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions