diff options
author | Sverker Eriksson <[email protected]> | 2014-09-11 17:47:32 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2014-09-12 14:19:04 +0200 |
commit | 12d3d25535225934cb2190c82c1b5dae005f1cda (patch) | |
tree | b292c837c3d0729900daa4a2cbeb7a6000e9f133 /erts/doc/src | |
parent | 84144e03cd902813d1c9f9d75a8b6ecc5e58270d (diff) | |
download | otp-12d3d25535225934cb2190c82c1b5dae005f1cda.tar.gz otp-12d3d25535225934cb2190c82c1b5dae005f1cda.tar.bz2 otp-12d3d25535225934cb2190c82c1b5dae005f1cda.zip |
erts: Remove enif_have_dirty_schedulers()
and add 'dirty_scheduler_support' to ErlNifSysInfo
Diffstat (limited to 'erts/doc/src')
-rw-r--r-- | erts/doc/src/erl_driver.xml | 5 | ||||
-rw-r--r-- | erts/doc/src/erl_nif.xml | 25 |
2 files changed, 10 insertions, 20 deletions
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; </code> @@ -610,6 +611,10 @@ typedef struct ErlDrvSysInfo { <tag><c>nif_minor_version</c></tag> <item>The value of <c>ERL_NIF_MINOR_VERSION</c> when the runtime system was compiled. </item> + <tag><c>dirty_scheduler_support</c></tag> + <item>A value <c>!= 0</c> if the runtime system has support for dirty scheduler threads; + otherwise <c>0</c>. + </item> </taglist> </item> <tag><marker id="ErlDrvBinary"/>ErlDrvBinary</tag> 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 <c>ERL_NIF_DIRTY_SCHEDULER_SUPPORT</c> 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 <seealso marker="#enif_have_dirty_schedulers"><c> - enif_have_dirty_schedulers()</c></seealso> API function, which returns true if dirty - scheduler threads are present, false otherwise.</p></note> + of dirty scheduler threads, code can use the <seealso marker="#enif_system_info"><c> + enif_system_info()</c></seealso> API function.</p></note> </item> </taglist> </section> @@ -807,22 +806,6 @@ typedef enum { and return true, or return false if <c>term</c> is not an unsigned integer or is outside the bounds of type <c>unsigned long</c>.</p></desc> </func> - <func><name><ret>int</ret><nametext>enif_have_dirty_schedulers()</nametext></name> - <fsummary>Runtime check for the presence of dirty scheduler threads</fsummary> - <desc> - <p>Check at runtime for the presence of dirty scheduler threads. If the emulator is - built with threading support, dirty scheduler threads are available and - <c>enif_have_dirty_schedulers()</c> returns true. If the emulator was built without - threading support, <c>enif_have_dirty_schedulers()</c> returns false.</p> - <p>If dirty scheduler threads are not available in the emulator, a call to - <c>enif_schedule_nif</c> with its <c>flags</c> argument set to indicate that the specified - NIF is to be executed on a dirty scheduler thread results in a <c>badarg</c> exception.</p> - <note><p>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 - <c>ERL_NIF_DIRTY_SCHEDULER_SUPPORT</c> is defined.</p></note> - </desc> - </func> <func><name><ret>int</ret><nametext>enif_inspect_binary(ErlNifEnv* env, ERL_NIF_TERM bin_term, ErlNifBinary* bin)</nametext></name> <fsummary>Inspect the content of a binary</fsummary> <desc><p>Initialize the structure pointed to by <c>bin</c> with @@ -1261,7 +1244,9 @@ typedef enum { <p>The <c>flags</c> argument must be set to 0 for a regular NIF, or if the emulator was built the experimental dirty scheduler support enabled, <c>flags</c> can be set to either <c>ERL_NIF_DIRTY_JOB_CPU_BOUND</c> if the job is expected to be primarily CPU-bound, or <c>ERL_NIF_DIRTY_JOB_IO_BOUND</c> for jobs that will - be I/O-bound.</p> + 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 <c>badarg</c> exception.</p> + <p>The <c>argc</c> and <c>argv</c> arguments can either be the originals passed into the calling NIF, or they can be values created by the calling NIF.</p> <p>The calling NIF must use the return value of <c>enif_schedule_nif</c> as its own return value.</p> |