Link to home
Start Free TrialLog in
Avatar of bknouse
bknouseFlag for United States of America

asked on

How to implement Multi-threading

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?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Tommy Hui
Tommy Hui

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial