Deno: Does the goal of the repo support multi thread?

Created on 7 Jun 2018  路  4Comments  路  Source: denoland/deno

if support multi thread? how to process the event loop? And what does the atom type look like?

Most helpful comment

Yeah that's a choice, but even in Rust should not change the essence of the core ideas

All 4 comments

libuv replaced by Goroutine + channel + WaitGroup, maintaining mostly the same functionality for event loop. See DispatchLoop(), Pub() and Sub() in dispatch.go. v8 is kept as sandbox (unlike node), and IO tasks are passed to Go through messaging.
(please correct me if I have any misinterpretation, thx!)

But @ry said there is some possibility to write deno with rust.
https://github.com/ry/deno/issues/11#issuecomment-394171740
So, maybe we should not limit ourselves in goroutine

Even decide not use rust, just use go, I don't think limiting ourselves in goroutine is a good idea. Goroutine is too special.

Goroutine is multi thread share one event loop.

Yeah that's a choice, but even in Rust should not change the essence of the core ideas

I would like to add workers at some point - if that's what you mean. JavaScript is single threaded tho.

Was this page helpful?
0 / 5 - 0 ratings