Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR#7158: Event.sync, Mutex.create, Condition.create cause too many GCs
Before, mutexes and condition variables were allocated with caml_alloc_custom and cost factor 1/N with N of a few hundreds or thousands. Hence GCs were triggered every N allocations approximately, which is bad. The motivation for this allocation cost was to cover the possibility that mutexes and condvars consume rare kernel resources. This appears not to be the case in Linux nor in Windows, and is unlikely to be the case in any robust implementation of POSIX threads. Hence this fix sets the cost factor to 0 in allocations of mutexes and condvars.
- Loading branch information
1 parent
eef390a
commit 84be1bc
Showing
2 changed files
with
8 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters