First-class Multi-threading support
zealot0630 at gmail.com
Fri Apr 26 08:53:33 UTC 2019
To support multi-thread, there are way more thing to clarify than just a
new thread function, here I'll list some of them:
1. Memory access model. can memory (variable) access be reordered to
improve performance ?
2. dead-lock-free and resource-safe fork-exec. When forking within a
multi-threaded process, can the new process avoid acquiring locks (like
malloc lock) which hold by other threads ? can the new process correctly
close all fd opened be other threads ?
3. Lock, mutex and conditional variable api.
Take python as an example, the thread support in python is horrible.
Everyone will suggest you don't use python threads, you will hit tons of
bug, workarounds while using it. When a high-level language is not designed
with multi-threaded support at the beginning, it will be nearly impossible
to add it later.
On Fri, Apr 26, 2019 at 2:41 AM Chinenye Onuegbu <kizer at kizer.com.ng> wrote:
avoided, even though there is a strong case for real multi-threading
event callback within 16ms to avoid dropping frames.
> To cover for some of these deficiencies, web workers, worker_threads,
process.fork, etc have been introduced in the past, all of which are
cumbersome to use. I understand that multi-threading is difficult to get
right, and it provides a number of challenges including making it easy to
create difficult-to-debug bugs, but I am of the opinion that we can at
least start a discussion on this.
> In light of this, I created a draft of what I think is a "safe" way to
link to the gist:
> A few things to note:
> 1. I am not an expert in multi-threading, and could have made some
otherwise obvious wrong assumptions/blunders
> 2. I am not an expert in JS engines, and do not know how easy/difficult
these are to actually bring to fruition
> I am looking for comments and constructive criticisms. Thanks in advance.
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss