What is a Single-Threaded Language?
What are Threads?
Threads are lightweight processes that run concurrently within a program. Each thread has its own stack and executes independently but shares resources such as memory, code, and data with other threads. Multithreading allows a program to perform several tasks simultaneously, which is useful for running heavy computations or handling multiple requests in a web application.
Q2: What is the difference between synchronous and asynchronous programming?
A: Synchronous programming blocks the execution of other code until a task completes, while asynchronous programming allows other code to continue executing while a task is running.
Q5: How do web workers work?