nodejs / help

:sparkles: Need help with Node.js? File an Issue here. :rocket:
1.44k stars 276 forks source link

I really want a thread model supported in nodejs, for multiple vCPU cloud server is very expensive. #4427

Closed AntiMoron closed 5 days ago

AntiMoron commented 1 week ago

What is the problem this feature will solve?

Current multiple thread is not real thread, it's implemented via progress. I think real thread should be imported after so many years.

What is the feature you are proposing to solve the problem?

Better use of CPU, can be used to have a better server concurrency with heavy tasks.

What alternatives have you considered?

I think posix thread model is good.

theanarkh commented 1 week ago

What does the Current multiple thread is not real thread, it's implemented via progress. mean ? worker_threads is implemented by OS thead.

AntiMoron commented 1 week ago

@theanarkh Where is that code link? I checked but couldn't find one.

joyeecheung commented 1 week ago

If you spawn a new worker_threads.Worker() then the thread backing that worker is an OS thread. See the documentation in https://nodejs.org/api/worker_threads.html#worker-threads

benjamingr commented 6 days ago

As the feature is implemented (worker_threads) I've moved this ticket to nodejs/help for support

RedYetiDev commented 5 days ago

As the feature is implemented (worker_threads) I've moved this ticket to nodejs/help for support

Hi! As previous replies have stated, the feature your requesting appears to be already implemented. As such, I'm closing this issue.

If you have more information, examples, etc. please open a new issue.