How to implement Multi-threading
Posted on 1998-01-11
I am building an SDI MFC application which has a user interface class and a database class. I am also using a virtual device driver to access the network interface card in a promiscuous mode. The packet monitor function makes a call to DeviceIoControl to retrieve any packets that arrive at the NIC. Since at any moment, there may or may not be a packet to read, I call GetOverlappedResult which waits indefinetly for a packet arrival. This, of course locks up the many windows GUI messages I am using to update the GUI, since windows is in a single thread mode and I am blocking any other progress. How should I implement this function to run under a separate thread and still have the packet results available to the other thread?