WaitForMultipleObjects()..
-
Hi. I have an application where I use WaitForMultipleObjects() to wait for any one ( ie) 'any of' not all ), of a number of events to become signalled. However, the maximum number of events that I can wait on in a single call to WaitForMultipleObjects is 64. I need to be able to wait on more than 64. I know that I could create groups of 64 and loop through them with a timeout until I get one of the events signalled. But, I cannot afford the time waiting for a timeout to occur, however small. If anyone has an idea of how I could get around this I would appreciate the help. James.
-
Hi. I have an application where I use WaitForMultipleObjects() to wait for any one ( ie) 'any of' not all ), of a number of events to become signalled. However, the maximum number of events that I can wait on in a single call to WaitForMultipleObjects is 64. I need to be able to wait on more than 64. I know that I could create groups of 64 and loop through them with a timeout until I get one of the events signalled. But, I cannot afford the time waiting for a timeout to occur, however small. If anyone has an idea of how I could get around this I would appreciate the help. James.
-
Would it be possible to have multiple threads waiting? Each thread would wait for no more than 64 events.
Thank you for the reply. I had thought of that, but again I did not want to compromise the throughput speed that the application currently delivers. But, I have been thinking about this all night and I cannot think of another solution that would 'scale' as well as your suggestion. So, it looks like thats the road I will have to take. Best regards. And again, thank you for the reply. James.
-
Thank you for the reply. I had thought of that, but again I did not want to compromise the throughput speed that the application currently delivers. But, I have been thinking about this all night and I cannot think of another solution that would 'scale' as well as your suggestion. So, it looks like thats the road I will have to take. Best regards. And again, thank you for the reply. James.
After much deliberation and study of my code, I have decided to abandon the idea of trying to handle more than 64 events. It is just not possible to integrate multiple threads, each waiting on a set of 64 events. I need to be able to maintain the current application throughput and the overhead would be too much. The list of events that I wait on is not constant and is waited on upto 3000 times per second. The intended user will just have to deal with the limitation. So thats that.