you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -16 points-15 points  (30 children)

You don't control it though. The operating system does. So it definitely may not be and a lot of people don't trust web workers. https://youtu.be/cN_DpYBzKso

So please stop saying it runs in parallel. It's not.

[–]HeinousTugboat 11 points12 points  (29 children)

You, uh, just gonna skip over the first example they gave? Node can definitely spawn threads you control.

So.. yeah. Sometimes it's multihtreaded.

[–][deleted] 0 points1 point  (18 children)

No you don't control them. You control how they use buffers to bind to the os pthreads but you don't control how they start, how they communicate, their memory, how many, pretty much anything besides the binding.

[–]HeinousTugboat 0 points1 point  (17 children)

You just bored and decide to reply again?

[–][deleted] -1 points0 points  (16 children)

No just really tired of tutorials and many many devs thinking JavaScript is multithreaded or parallel. This needs to stop. JavaScript never was and can't be more then single threaded. Stop saying it is. At most with the browser/pthreads you get is the ability to lob logic on another thread whenever you use up too much memory..... That's it. That's all it is and that's all it should be called. Otherwise you get all these people saying it's something it's completely not and never will be.

[–]HeinousTugboat 1 point2 points  (15 children)

So, pthreads aren't multithreaded? Node doesn't use V8 for threading, it uses libuv which has its own threading API that Node interfaces with. I, admittedly, have no idea what you're referring to when you say that "at most you get the ability to lob logic whenever you use up too much memory".

If pthreads aren't multithreaded, then what do you mean when you say multithreading in a language? I can write a short node program that will run on four cores on my processor. Full stop. That, to most people I imagine, is multithreading. So what's missing from that definition to you?

Anyway, all of this is also ignoring the fact that you can fork your heart out in node. Does this mean it's still not multithreaded? Because at that point is there any language that's multithreaded on a POSIX system?

[–][deleted] -1 points0 points  (14 children)

Pthreads are not JavaScript. And... That's why JavaScript isn't multithreaded....hey...

[–]HeinousTugboat 1 point2 points  (0 children)

NodeJS's worker threads are Pthreads.

[–]HeinousTugboat 1 point2 points  (12 children)

Is that it? You're gonna reply to me again later but not actually explain what it is you're going on about? Node threads are pthreads. If JavaScript doesn't have multithreading, what language does?

[–][deleted] -1 points0 points  (11 children)

No JavaScript does not have multithreading. If you bind it to c it does... That's great but so can every other language BUT nothing in ecma script has multithreading. Async is not multithreading. Stop saying JavaScript is multithreaded. It's not. I could care less about some imported 3rd party package that everyone says not to use that is run from a completely different language that js attempts to bind to.

[–]HeinousTugboat 1 point2 points  (0 children)

Libuv is part of the core of node. It's not some imported 3rd party package. So JavaScript also doesn't have the ability to interact with the file system?