samedi 23 mai 2015

C++ Multithreading Run function on main thread

I have a thread with a TCP Socket that connects to a server and waits for data in a while loop, so the thread never ends. When the socket receives data, it is parsed, and based on the opcode of the packet, should call x function. Whats the fastest/best way to go about that?

I read around that doing some kind of task/message queue system is a way of doing it, but not sure if there is any better options.

Should mention that I can not use boost.

Aucun commentaire:

Enregistrer un commentaire