Enable true incremental collection even if parallel marker is on
authorIvan Maidanski <ivmai@mail.ru>
Tue, 16 Apr 2019 21:52:59 +0000 (00:52 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 17 Apr 2019 06:29:30 +0000 (09:29 +0300)
commit3c571c7ad66a90e33e4701afe3dc4d2113c60adc
tree14017bf6bcb2d2ebc32bf9362509b4f8277a1396
parenta57e1b4dcebd5b5bda4574e2732498e38c1543d0
Enable true incremental collection even if parallel marker is on

Issue #151 (bdwgc).

Because of the current limitation of the parallel marker implementation,
it is not possible to interrupt the collection when performed by the
parallel marker.  This change allows to have the true incremental mode
at the expense of disabling the parallel marker during most collection
phases.  By default, the old behavior (a generational collection with
the parallel marker enabled) is preserved unless the client sets
GC_time_limit to a value other than GC_TIME_UNLIMITED.

* alloc.c [(!GC_TIME_LIMIT || CPPCHECK) && PARALLEL_MARK]
(GC_time_limit): Set to GC_TIME_UNLIMITED; add comment.
* alloc.c [PARALLEL_MARK] (GC_collect_a_little_inner): Temporarily
set GC_parallel_mark_disabled to TRUE before GC_mark_some repeated
invocation if GC_time_limit is not GC_TIME_UNLIMITED.
* alloc.c [PARALLEL_MARK] (GC_stopped_mark): Temporarily set
GC_parallel_mark_disabled to TRUE before GC_mark_some repeated
invocation if stop_func is not GC_never_stop_func; add verbose logging
if parallel marking is disabled temporarily.
* doc/README.environment (GC_PAUSE_TIME_TARGET): Update the description
(remove the limitation for the case when parallel marking is on).
* doc/scale.md (The Parallel Marking Algorithm): Update the
documentation regarding incremental mode.
* include/gc.h (GC_parallel, GC_enable_incremental): Update the comment
(remove the limitation on the incremental mode when parallel marking
is on).
* include/private/gc_priv.h [PARALLEL_MARK] (GC_parallel_mark_disabled):
Declare global variable.
* mark.c [PARALLEL_MARK] (GC_parallel_mark_disabled): Define.
* mark.c [PARALLEL_MARK] (GC_mark_some_inner): Do not call
GC_do_parallel_mark() if GC_parallel_mark_disabled; update comment.
* pthread_support.c [PARALLEL_MARK] (GC_thr_init): Do not set
GC_time_limit to GC_TIME_UNLIMITED if available_markers_m1 > 0; remove
comment.
* win32_threads.c [PARALLEL_MARK] (GC_thr_init): Likewise.
alloc.c
doc/README.environment
doc/scale.md
include/gc.h
include/private/gc_priv.h
mark.c
pthread_support.c
win32_threads.c