banksyb00mb00m · 2022-08-09 15:58
stepbroImstuck_in_SU · 2022-08-09 18:05
“So nothing can be multithreaded?”
“Hah! You wish!”
lstrang · 2022-08-09 18:13
Nice video. I vote: "keep whacking"
lebensterben · 2022-08-09 19:10
I wish all speakers speak so articulated
tromey · 2022-08-09 20:35
The stuff about unwinding/rewinding the bindings is true but not necessarily done this way. Originally when I wrote this code, I had a more complicated implementation that stored thread-local bindings as an alist (IIRC) in the symbol value. However, in the meantime one of the Emacs maintainers rewrote this area, and as this code was complicated and tricky to get right the first time, I opted to rewrite it in a simpler way rather than figure it all out again. So, this could be fixed.
For non-Elisp globals, the answer is to move them into `struct thread_state`. When working on threads I did this for a number of globals, but essentially just the ones I thought were needed at the time.
Globals are just one of the problems with lifting the GIL. The more difficult problem is that various Elisp primitives themselves aren't thread-safe. For example, what happens if two threads `setcar` at the same time? Basically what you have to do is trawl through the code and ensure that whatever invariants are necessary are upheld by all mutations, possibly introducing locks to do so. This is non-trivial.
Another option here is to do what Python does, and release the GIL periodically. There's nothing wrong with this, but when it was suggested it was rejected by the Emacs maintainers.
agumonkey · 2022-08-09 20:42
fun video
Firewolf420 · 2022-08-09 21:12
Data meets Dictionary, clean af diction
arthurno1 · 2022-08-09 21:32
Thanks for the writing. Interesting read.
> when it was suggested it was rejected by the Emacs maintainers.
What was the motivation?
matyklug · 2022-08-10 03:40
This was, an, interesting, watch.
indigo0086 · 2022-08-10 06:07
Te way he spoke about the topic I never felt fully lost, despite not having a full understanding of everything said.