From 615b79a01706033e1ef0d78f020ebbb47fc80b86 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Thu, 16 Jun 2016 17:33:28 +0200 Subject: Add documentation about dirty job type --- erts/doc/src/erl_nif.xml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'erts/doc/src/erl_nif.xml') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 8b02b3bae1..c9b2092c17 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -442,6 +442,24 @@ ok dirty NIF has completed.

+

+ It is important to classify the dirty job correct. An I/O bound + job should be classified as such and execute on a dirty I/O + scheduler, and a CPU bound job should be classified as such and + execute on a dirty CPU scheduler. If you classify CPU bound jobs + as I/O bound jobs, dirty I/O schedulers might starve ordinary + schedulers. For more information see the documentation + of the erl command line arguments + +SDcpu, and + +SDio as well + as enif_schedule_nif, + and ErlNifFunc. + A job that alternates between I/O bound and CPU bound can + be reclassified and rescheduled using enif_schedule_nif + so that it exectutes on the correct type of dirty scheduler + at all times. +

+

Currently known issues that are planned to be fixed:

@@ -1702,7 +1720,7 @@ enif_map_iterator_destroy(env, &iter); be converted to an atom, enif_schedule_nif returns a badarg exception.

The flags argument must be set to 0 for a regular NIF, or if the emulator was built the experimental dirty scheduler support enabled, flags can be set to either ERL_NIF_DIRTY_JOB_CPU_BOUND - if the job is expected to be primarily CPU-bound, or ERL_NIF_DIRTY_JOB_IO_BOUND for jobs that will + if the job is expected to be CPU-bound, or ERL_NIF_DIRTY_JOB_IO_BOUND for jobs that will be I/O-bound. If dirty scheduler threads are not available in the emulator, a try to schedule such a job will result in a badarg exception.

-- cgit v1.2.3