summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2020-08-13 16:49:03 +0300
committerIvan Maidanski <ivmai@mail.ru>2020-08-13 16:49:03 +0300
commitee900ca80085032156573517998c6cbfa1494377 (patch)
tree49be4fcf55373bfb8603f8b751564d3dab7a8ba7 /doc
parent1465f95018cacd77a1654f4a07ed2c051b1da821 (diff)
downloadbdwgc-ee900ca80085032156573517998c6cbfa1494377.tar.gz
New API (GC_set_markers_count) to control number of parallel markers
Issue #320 (bdwgc). Note that GC_set_markers_count() has effect only if called before GC initialization. For convenience, alternatively the client could define GC_MARKERS macro with the appropriate value before include of gc.h. * doc/README.macros (GC_MARKERS): Document. * include/gc.h [GC_THREADS] (GC_parallel): Update comment. * include/gc.h [GC_THREADS] (GC_set_markers_count): New API function declaration. * include/gc.h (GC_INIT_CONF_MARKERS): New internal macro (defined to GC_set_markers_count(GC_MARKERS) if GC_THREADS and GC_MARKERS are defined). * include/gc.h (GC_INIT): Call GC_INIT_CONF_MARKERS before GC_init. * pthread_support.c [PARALLEL_MARK] (required_markers_cnt): New static variable (initialized to 0). * win32_threads.c [PARALLEL_MARK] (required_markers_cnt): Likewise. * pthread_support.c (GC_set_markers_count): New API function definition (empty unless PARALLEL_MARK). * win32_threads.c [PARALLEL_MARK] (GC_set_markers_count): Likewise. * pthread_support.c [PARALLEL_MARK] (GC_thr_init): Initialize markers local variable to required_markers_cnt; set markers to GC_nprocs only if markers_string is null and required_markers_cnt (markers) value is zero. * tests/test.c [GC_PTHREADS] (main): Call GC_set_markers_count(0) before GC_COND_INIT(). * win32_threads.c [PARALLEL_MARK] (GC_thr_init): Initialize markers local variable to required_markers_cnt; set markers to ncpu only if markers_string is null and required_markers_cnt (markers) value is 0.
Diffstat (limited to 'doc')
-rw-r--r--doc/README.macros4
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/README.macros b/doc/README.macros
index 1fd1f321..247b4154 100644
--- a/doc/README.macros
+++ b/doc/README.macros
@@ -87,6 +87,10 @@ GC_NOT_DLL User-settable macro that overrides _DLL, e.g. if runtime
dynamic libraries are used, but the collector is in a static
library. Tested by gc_config_macros.h.
+GC_MARKERS=<n> Set the desired number of marker threads. If not defined or
+ defined to zero, then the collector decides based on the
+ number of CPU cores. Only if compiled with PARALLEL_MARK.
+
These define arguments influence the collector configuration: