4 ms·
Yes, it's the GIL [1] [1]: https://en.wikipedia.org/wiki/Global_interpreter_lock https://en.wikipedia.org/wiki/Global_interpreter_lock
by faisal_ksa 5y ago
Yes, it's the GIL [1]
[1]: https://en.wikipedia.org/wiki/Global_interpreter_lock https://en.wikipedia.org/wiki/Global_interpreter_lock
- nathancahill 5y agohttps://mail.python.org/archives/list/python-dev@python.org/thread/ABR2L6BENNA6UPSPKV474HCS4LWT26GY/ https://mail.python.org/archives/list/python-dev@python.org/...
- wk_end 5y agoThe GIL just prevents thread-level parallelism - which JavaScript also doesn’t have.
- _bohm 5y agoIt depends on the runtime environment, no? For example, Node supports worker threads https://nodejs.org/api/worker_threads.html https://nodejs.org/api/worker_threads.html
- RussianCow 5y agoWorker threads are share-nothing, closer to processes than actual threads.
- inglor 5y agoWorker threads aren't share-nothing, you can share data through SharedArrayBuffer which lets you share arbitrary binary data. If they were share nothing, we probably wouldn't have shipped them. Source: I'm Node.js core and one of the people who worked on them
- zielmicha 5y agoYou can also share arbitrary binary data between processes by using shared memory (e.g. Python has support for this in multiprocessing.shared_memory module).
- RussianCow 5y agoSorry, I realized after posting that I should have said "share-nothing by default". There are ways to share memory with a worker, but it's explicit and opt-in via a dedicated API. It's not like in Python where you can arbitrarily change global state from any thread.