diff --git a/docs/README.macros b/docs/README.macros index ec4fbe812..e17d13308 100644 --- a/docs/README.macros +++ b/docs/README.macros @@ -411,6 +411,10 @@ GC_USE_DLOPEN_WRAP Causes the collector to redefine malloc and dlopen and dlsym to refer to the original versions. This makes it possible to build an LD_PRELOADable malloc replacement library. +USE_RWLOCK Use rwlock for the allocator lock instead of mutex. + Thus enable usage of the reader (shared) mode of the allocator lock where + possible. + THREAD_LOCAL_ALLOC Defines GC_malloc(), GC_malloc_atomic() and GC_gcj_malloc() to use a per-thread set of free-lists. These then allocate in a way that usually does not involve acquisition of the allocator (global) diff --git a/docs/scale.md b/docs/scale.md index f58f7c40d..5b8e844f2 100644 --- a/docs/scale.md +++ b/docs/scale.md @@ -61,6 +61,13 @@ This _reduces performance_ for the standard allocation functions, though it usually improves performance when thread-local allocation is used heavily, and, thus, the number of short-duration lock acquisitions is greatly reduced. +Also, `USE_RWLOCK` macro (experimental) should be noted which changes the +allocator lock implementation base from a mutex (`CRITICAL_SECTION` in case +of Win32) to `pthread_rwlock_t` (`SRWLOCK`, respectively), thus enabling +acquisition of a slim lock in the reader (shared) mode where possible. See +the description of `GC_call_with_reader_lock` and `GC_REVEAL_POINTER` entities +in `gc.h` for more details. + ## The Parallel Marking Algorithm We use an algorithm similar to