Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement waitAny on more than 64 handles?

How to implement waitAny on more than 64 handles?

I have simple problem, i have many threads working until end of data, when thread is end of data then signalling to thread on what i running this waitAny for idle thread and give him next package of data.

like image 411
Svisstack Avatar asked Jan 17 '23 15:01

Svisstack


1 Answers

You might want to consider implementing something like a queue for notification packets for the 'waitAny' thread to wait on. When one of your multitude of threads completes it's operation, it places a notification packet on the queue. Your waitAny turns into a wait on a single event that indicates something is in the queue.

like image 88
Michael Burr Avatar answered Jan 20 '23 05:01

Michael Burr