I've developed a TCP client/server application where four different clients talk to one sever. The client application was modified from the tcp\client.cws sample, and the server was modified from the tcp\MultiClientServer.cws sample. In my application, the server controls something that the four clients must share. So, from the MultiClientServer example, I have four separate threads handling the requests from the clients, but after the individual threads interpret the requests, the threads will have to call a common function to apply the requests.
Should the common function be in the main thread? How do I do this call? With PostDeferredCall? Or, just call the common function from each of the threads?
Should I create a fifth thread which the common function runs in? If so, how do I call it? With PostDeferredCallToThread (if the common function is in the fifth thread)?