If non-blocking code transfers the CPU to 100%

I was thinking about NodeJS today, and this attitude to blocking, it made me wonder if the code block is purely non-blocking, say, calculating some real long alogirthm and variables are all present on the stack, etc. should this be clicked on a single core without a hyperthread on the processor, since the windows task manager defines it 100%, since it seeks to complete this task as quickly as possible? Say this is usually a calculation, which can take several minutes.

+3
source share
4 answers

Yes it should. The algorithm should work as quickly as possible. This is the job of the operating system to schedule time for other processes if necessary.

+5

100% CPU, . , , 99% .

+1

, "" , , , , : CPU, , - ?

0

, . , , . 100%.

0

Source: https://habr.com/ru/post/1732171/


All Articles