What is Thread?
The smallest unit of execution within a process, allowing concurrent operations to run within a single program.
Threads share the same memory space within a process, enabling parallel execution of tasks. Multi-threading improves performance for CPU-bound tasks on multi-core processors and keeps applications responsive during I/O operations.
Challenges include race conditions (concurrent access to shared data), deadlocks (threads waiting on each other), and thread safety. Synchronization primitives (mutexes, semaphores) coordinate access. Modern approaches include async/await and actor models.