From 12d3d25535225934cb2190c82c1b5dae005f1cda Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 11 Sep 2014 17:47:32 +0200 Subject: erts: Remove enif_have_dirty_schedulers() and add 'dirty_scheduler_support' to ErlNifSysInfo --- erts/doc/src/erl_driver.xml | 5 +++++ erts/doc/src/erl_nif.xml | 25 +++++-------------------- 2 files changed, 10 insertions(+), 20 deletions(-) (limited to 'erts/doc/src') diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index ad37813ac0..4a1aab75c7 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -546,6 +546,7 @@ typedef struct ErlDrvSysInfo { int scheduler_threads; int nif_major_version; int nif_minor_version; + int dirty_scheduler_support; } ErlDrvSysInfo; @@ -610,6 +611,10 @@ typedef struct ErlDrvSysInfo { nif_minor_version The value of ERL_NIF_MINOR_VERSION when the runtime system was compiled. + dirty_scheduler_support + A value != 0 if the runtime system has support for dirty scheduler threads; + otherwise 0. + ErlDrvBinary diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 1d33b334bb..3de94be9ff 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -374,9 +374,8 @@ ok the dirty NIF API is available, native code can check to see if the C preprocessor macro ERL_NIF_DIRTY_SCHEDULER_SUPPORT is defined. Also, if the Erlang runtime was built without threading support, dirty schedulers are disabled. To check at runtime for the presence - of dirty scheduler threads, code can call the - enif_have_dirty_schedulers() API function, which returns true if dirty - scheduler threads are present, false otherwise.

+ of dirty scheduler threads, code can use the + enif_system_info() API function.

@@ -807,22 +806,6 @@ typedef enum { and return true, or return false if term is not an unsigned integer or is outside the bounds of type unsigned long.

- intenif_have_dirty_schedulers() - Runtime check for the presence of dirty scheduler threads - -

Check at runtime for the presence of dirty scheduler threads. If the emulator is - built with threading support, dirty scheduler threads are available and - enif_have_dirty_schedulers() returns true. If the emulator was built without - threading support, enif_have_dirty_schedulers() returns false.

-

If dirty scheduler threads are not available in the emulator, a call to - enif_schedule_nif with its flags argument set to indicate that the specified - NIF is to be executed on a dirty scheduler thread results in a badarg exception.

-

This function is available only when the emulator is configured with dirty - schedulers enabled. This feature is currently disabled by default. To determine whether - the dirty NIF API is available, native code can check to see if the C preprocessor macro - ERL_NIF_DIRTY_SCHEDULER_SUPPORT is defined.

-
-
intenif_inspect_binary(ErlNifEnv* env, ERL_NIF_TERM bin_term, ErlNifBinary* bin) Inspect the content of a binary

Initialize the structure pointed to by bin with @@ -1261,7 +1244,9 @@ typedef enum {

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 - be I/O-bound.

+ 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.

+

The argc and argv arguments can either be the originals passed into the calling NIF, or they can be values created by the calling NIF.

The calling NIF must use the return value of enif_schedule_nif as its own return value.

-- cgit v1.2.3