Bringing multithreading to UVM #42
maximecb
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
After a hiatus for several months, I restarted development of UVM. My main focus so far has been in adding support for multithreading. I was originally intending for UVM to have actor-based parallelism, but that doesn't necessarily fit with what most people expect, so I decided to go for threads which is simpler.
I added new syscalls like
thread_spawn
andthread_join
.There are no more callbacks for the UI. Instead you call
window_poll_event
orwithout_wait_event
(blocking) to read events. For reference, I updated the example programs to make use of these.Next I will add some thread-local variables, which will be necessary to implement C stack allocation for structs and arrays. At the moment if two threads stack allocate it won't work correctly.
I also need to add some primitives for atomic loads and stores. Right now there are no synchronization primitives. It would technically still be feasible to implement something like a parallel raytracer or to use a background thread for audio rendering where the audio thread reads control parameters from memory, but atomics will be needed to implement locking for more complex programs... Right now there is no way to implement a thread-safe message queue for example. I need to read more about atomics because I don't fully get all the subtleties yet.
Questions and comments welcome! :)
Beta Was this translation helpful? Give feedback.
All reactions