Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document locking behavior of the default GC #4132

Open
dlangBugzillaToGithub opened this issue Jun 21, 2023 · 0 comments
Open

Document locking behavior of the default GC #4132

dlangBugzillaToGithub opened this issue Jun 21, 2023 · 0 comments

Comments

@dlangBugzillaToGithub
Copy link

Andrej Mitrovic (@AndrejMitrovic) reported this on 2023-06-21T10:00:16Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=24006

Description

As Steven mentions here: https://forum.dlang.org/post/u6tgl4$1v07$1@digitalmars.com

> 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)."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant