Skip to content

Erlang dirty schedulers are not actually being used in many cases (if not in all the cases) #71

Description

@timofey-barmin

The following macro in enacl_nif.c determines if dirty schedulers are to be used or not:

#ifdef ERL_NIF_DIRTY_JOB_CPU_BOUND
#define erl_nif_dirty_job_cpu_bound_macro(a, b, c)                             \
  { a, b, c, ERL_NIF_DIRTY_JOB_CPU_BOUND }
#else
#define erl_nif_dirty_job_cpu_bound_macro(a, b, c)                             \
  { a, b, c }
#endif

The problem with that code is that ERL_NIF_DIRTY_JOB_CPU_BOUND is not actually defined.
ERL_NIF_DIRTY_JOB_CPU_BOUND has always been a enum, so "ifdef" can't be used for checking it.
This leads to the fact that the #else branch works all the time, and dirty schedulers are not actually being used for functions like pwhash where it is absolutely necessary.

Please consider the following PR to fix that problem: #70

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