There's a lot of confusion out there about concurrency and parallelism. Some people use the terms interchangeably, but they actually refer to two different things.
Concurrency is when two or more tasks can start, run, and complete in overlapping time periods. It doesn't necessarily mean that they'll be running at the same time, but they can be interleaved so that at any given time, there is always one task running.
Parallelism is when two or more tasks can truly run at the same time. In order for this to happen, the tasks must be able to run on separate CPUs or cores.
So why is it important to understand the difference? Concurrency is important because it allows you to structure your code in a way that makes efficient use of resources. Parallelism is important because it can dramatically improve performance by doing more than one thing at a time.
If you're writing code that will be running on a single CPU or core, then you need to be aware of concurrency issues. If your code will be running on multiple CPUs or cores, then you need to be aware of parallelism issues.
NodeJS is a single-threaded platform. This means that it can only process one request at a time. So, how does it handle multiple requests?
This event-driven model is very efficient and allows NodeJS to handle thousands of concurrent requests with ease.
#krishdinesh #nodejs #concurrency
Support to Channel: https://paypal.me/HelloKrish
Facebook: / krish.dinesh.official
Instagram : / krish.dinesh.official
twitter: / krishantha (@Krishantha)
Смотрите видео Let's solve a most popular myth..!!! How does NodeJS handle multiple requests? онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Krish Dinesh 23 Октябрь 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 6,191 раз и оно понравилось 234 людям.