Skip to content

Conversation

jclab-joseph
Copy link

@jclab-joseph jclab-joseph commented Dec 18, 2023

  • amd64/linux createThread
  • amd64/windows createThread
  • 386/linux createThread
  • arm/linux createThread
  • arm64/linux createThread
  • arm64/linux createThread
  • testdata
  • Leave possible pause to the OS.

#2290 must be merged first.

This is a draft of a threads scheduler implementation as a cornerstone of a multi-core implementation.

I can't do it alone. I would love to work together.

See #2446

niaow and others added 2 commits December 18, 2023 10:12
This changes task.Stack and task.Queue to use atomic compare-and-swap operations.
With this change, they can also be executed safely from multiple threads/cores.
Additionally, the queue is actually LIFO now (not sure what I was thinking before).
@dgryski
Copy link
Member

dgryski commented Dec 21, 2023

In addition to the scheduler, the sync/* packages probably needs to be rewritten to account for concurrency.

@jclab-joseph
Copy link
Author

Yes,
Need to test it further, but once #2290 is merged, Mutex, Cond, etc. will likely be thread safe.

@aykevl
Copy link
Member

aykevl commented Feb 25, 2024

Another important piece is the garbage collector. You need to find a way to pause all other threads while the GC is running.

@jclab-joseph
Copy link
Author

Close by #4559

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants