|
Alternatives to Multi-ThreadingIt's important to understand how your operating system functions. For Microsoft Windows the operating system is 'event-orientated'. This means that Windows applications operate with an event loop where the operating system is sending a continual stream of 'callbacks' or 'messages' to your application, which then responds. The application's message handler should never take too long to return to get the next message from the operating system. This type of design supports a great deal of concurrency since the processor is constantly switching between different tasks, but without the overhead of multi-threading. In the case of the TCP/IP system in Windows, the operating system is taking care of the guaranteed delivery of the data, which therefore fulfils many things that a developer might think they are trying to achieve with multi-threading. |