3VH_sOvcQFqywiEWLS_FNg.jpeg

I hope you remember that in the first episode, we read through the Node.js Wikipedia page. One of the key points we came across was the statement that "Node.js has an event-driven architecture capable of asynchronous I/O.” So, this episode is focused on explaining that concept.

image.png


Lets start with the fundamentals of JavaScript first

Q: What is Thread?

A thread is the smallest unit of execution within a process in an operating system. It represents a single sequence of instructions that can be managed independently by a scheduler. Multiple threads can exist within a single process, sharing the same memory space but executing independently. This allows for parallel execution of tasks within a program, improving efficiency and responsiveness. Threads can be either:

1) Single-threaded

2) Multi-threaded

Q: What type of threading does JavaScript use?

image.png


Synchronous vs Asynchronous JavaScript

Q: What is a Synchronous System?

In a synchronous system, tasks are completed one after another.