Bug 24006 – Document locking behavior of the default GC

Status
NEW
Severity
enhancement
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2023-06-21T10:00:16Z
Last change time
2024-12-15T15:27:51Z
Assigned to
No Owner
Creator
Andrej Mitrovic
Moved to GitHub: dlang.org#4132 →

Comments

Comment #0 by andrej.mitrovich — 2023-06-21T10:00:16Z
As Steven mentions here: https://forum.dlang.org/post/[email protected] > The D GC has a single global lock to allocate memory -- even memory that might be on a free list. So the threads are all bottlenecked on waiting their turn for the lock. This behavior isn't documented on https://dlang.org/spec/garbage.html But it is mentioned in passing on this page: https://dlang.org/articles/d-array-article.html#caching Specifically "Doing this means an O(lg(n)) lookup in the GC's memory pool for every append (not to mention acquiring the global GC lock)."
Comment #1 by robert.schadek — 2024-12-15T15:27:51Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dlang.org/issues/4132 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB