A single thread runs the entire program. No two tasks can run at the exact same time.Drawing 2024-09-16 20.32.50.excalidraw
⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠
Text Elements
Synchronous
Start
end
Single thread for single program
Link to original
Blocking
Code that blocks like nodeJS syncing functions will end up stalling and preventing the other code to run, while it performs its operations. Blocking code should always be turned into NodeJS Events, to make them Asynchronous. Example:
See more in NodeJS Read File