Hi everyone.
We are trying to develop an application involving 1 producer and 14 consumers simultaneously accessing a circular buffers.
The producer is entitled to produce data bytes and store them into several buffers (depending on the kind of data it produces). The consumers are entitled to retrieve data bytes from the buffer and use them to perform operations such as graphic display and file data logging.
Basically there are the producer and a pair of consumers per circular buffer; one consumer for graphic display and another one for file data logging. There is a total of 7 buffers each of which refers to a specific physical data acquisition channel.
The concurrent access to the circular buffer is protected by a pair of semaphores, and one mutex (that we believe can be removed).
The application run smoothly for a limited number of channels but it crashes when handling all the 7 channels.
Running in debug mode QT4.5 under Windows XP - SP3, we observe that the application get stuck during the call to tryAcquire, and more specifically to the QMutexLocker locker(&d->mutex); statement of it.
Do you think that there is a maximum amount of semaphores that can be used within an application ?
Do you have any suggestion on things that need to be considered while dealing with threads, semaphores, mutexes and such ?
Thanks to you all.
Bookmarks