Multithreaded TWS MFC application: Yes or No

Multithreading is a nut for several years by now. This is the only way to achieve scalability: CPU clocking is close to limit.

There are a lot of cookbooks explaining how to build multithreaded applications properly. The only issue is that building a block of the application could be inappropriate for that.

MFC version of EClientSocket contains the following code:

The class is trying to handle some windows message so we need to instantiate it in the main application thread.

Conclusion one: MFC version of TWS EClientSocket is not the best candidate for using in multithreaded applications.

Conclusion two: Apart from the rest, be aware of using classes with AfxGetThread and PumpMessage in implementation. Most likely they will cause an issue in multithreaded applications.