pselect threads signals
hi.
I have to do an application in which more clients can connect to a server requesting some io operations. The server must handle all this requests in a number of threads. The number of threads that the server has, is limited, but not the io operations requested by the clients. So, I will use aio operations and when an aio operation ends a signal will be sent to the thread.
I can handle all this except I have a problem. I don't know how to handle the requests from the clients and the signals in the same time. pselect might be the answer but I can't understand properly how it works. Is it blocant?
Let's say I have a signal that will announce to the threads when the aio operation ends. This signal will be sent to the process and the handler will see what thread must receive this signal and will "forward" it.
But, in the main thread I have the "select". Will this signal stop the "select"? Should I use pselect instead and block the signal before? And if I do so, this, won't block my application cause pselect is blocant as I understood.
Can someone please, give some details...
Thank you.
|