Multithreading using wait/notification mechanism

Started by
29 comments, last by JohnnyCode 8 years, 11 months ago

I have used Listen() function on a tcp socket for letting a thread not use CPU anymore but still be ready for issues. I was then establishing from requesting threads connection to it and sending instruction data over the socket, what got me free of the racing conditions. The main thread then just peeked for result with a read function on an unblocking socket. It is quite instant, though instruction data is thus copied and response data is copied too, but I consider it quite a trivial cost. I could issue to worker instructions to process even if previous work did not finish so I could utilize actualy 8 threads multithreading of the cpu, managed purely by the worker server.

This topic is closed to new replies.

Advertisement