Re:A viable solution for Python concurrency
by catlifeonmars on Friday October 15, 2021 @03:53PM
(#28882334)
JS now has shared array buffers.
Re:A viable solution for Python concurrency
by laurencerowe on Friday October 15, 2021 @04:04PM
(#28882487)
SharedArrayBuffer is just raw memory similar to using mmap from Python multiprocessing. The developer experience is very different to simply sharing objects across threads.
JavaScript doesn't need a GIL because it doesn't really have threads. WebWorkers are more akin to multiprocessing than threads in Python. Objects cannot be shared directly across WebWorkers so transferring data comes with the expense of serializing/deserializing at the boundary.