tinygo icon indicating copy to clipboard operation
tinygo copied to clipboard

Draft: threads scheduler

Open jclab-joseph opened this issue 8 months ago • 3 comments

  • [X] 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.

https://github.com/tinygo-org/tinygo/pull/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 https://github.com/tinygo-org/tinygo/issues/2446

jclab-joseph avatar Dec 18 '23 02:12 jclab-joseph

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

dgryski avatar Dec 21 '23 19:12 dgryski

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

jclab-joseph avatar Dec 21 '23 22:12 jclab-joseph

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

aykevl avatar Feb 25 '24 14:02 aykevl