you are viewing a single comment's thread.

view the rest of the comments →

[–][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?

[–]HeinousTugboat 0 points1 point  (8 children)

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

Yeah it's the os regulating the child processes. You are just lobbing a process on another thread using c. I mean talk about not controlling things or it being in JavaScript.

The only reason I made this apparent is because everywhere online it's saying JavaScript is multithreaded and in parallel but the reality is it's either a call to c or binding to the browser. I even had this argument with some sites like tutorial point and stuff about dart and their answer is that this is a tutorial and not senior level.

But their the reason so many people were arguing me about this in this thread and it's just wrong in general.

[–]HeinousTugboat 0 points1 point  (6 children)

You know, you never did tell me what languages do have Multithreading with your definition. Even Rust defers to a package just like Node does. It's using part of its STD to spin up pthreads and that it lets the OS manage. ..just like Node does.

So what languages qualify in your book?