The documentation for CmtInstallTSQCallback notes that only one callback can be assigned for any particular event. Is this one callback for the entire application, or per thread? I have a situation where I have one writer and N readers, and would like all the readers to receive a callback when data is available in the queue.
In case you are wondering why, in my application I have a main tread, and then several other threads which each handle receiving data from a specific hardware device (via rs232, ethernet, or gpib). When the main thread has a command to send to one of the devices (issued via the GUI, or sent to it from another program over the network), it pushes the command into a thread-safe queue. The device threads each check the queue when they are not busy receiving data, and if the command is for their device, they execute it and then remove it from the queue. The reason that I am using a single queue for all the devices is to make it easy to ensure that commands are executed in the order that they are generated. I would like for reading to be handled by callbacks rather than polling in an attempt to decrease latency and processor usage, but wanted to check that this is possible before reworking the code.