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

Parallelize collector #21

Open
ysbaddaden opened this issue Jun 10, 2022 · 0 comments
Open

Parallelize collector #21

ysbaddaden opened this issue Jun 10, 2022 · 0 comments

Comments

@ysbaddaden
Copy link
Owner

ysbaddaden commented Jun 10, 2022

The collector is significantly slower than BDWGC. There must be room for enhancement, for example:

  1. unmark small and large objects in parallel;
  2. scan/mark objects from multiple threads;
  3. sweep small and large HEAPs in parallel;

About parallel marking, a naive attempt would be to make Stack thread-safe and execute GC_Collector_mark() from multiple threads, but Stack will become a contention point (too many concurrent push and pop). It would be better to have a global stack, where we push the fiber stack roots, and thread-local ones, where each thread would push/pop objects to scan; with an eventual steal of objects from other threads when their is nothing left to do (e.g. steal half the objects from another thread). If that's reminiscent of how a job stealing scheduler works... this is on purpose!

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