Some time ago, I did a software that made use of multiple (or simultaneous) UP or DOWN operations on semaphores. At that time, Qt don't had a QSemaphore class yet, so I had to do it with the OS API.
The application was dedicated to Linux, and i had no problem to do that with the semop function. I just had to pass a sembuf structure array to the function and, specify the operations (UP or DOWN) for each semaphore. The OS API assured me that the operation had to be done simultaneously, so I don't had any disturbance. If all operations couldn't be done simultaneously, the thread was blocked.
Now, facing the same problem, on a multiplataform approach (windows, linux ...), I'm thinking to use a QSemaphore class, but I don't see how can I do it, because this class have no "multiple_acquire_release" method.
P.S.: A VERY important note... I can't do the operations (down's and up's) sequentially, I have to do it simultaneously.
Can someone help me with that?
Regards,
Diogo.
Bookmarks