FAQ.MultiThreading
Introduction
- What is a thread ?
- What is multithreading ?
- Advantages & Disadvantages
The Main Question
Do i need Threads ?
Cases where needed and where not needed
A Thread per Socket
When incoming connection, encapsulating socket within a thread, and managing communication within the thread, across several threads
A Worker Thread
When running a lengthy process (SQLing a RBDMS, doing bottlenecked I/O, ...), and to prevent GUI from freezing, encapsulating it in a thread (JobThread), and sending back data when the thread is done (or simulating a process end).