Results 1 to 4 of 4

Thread: 1 producer 14 Consumers problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default 1 producer 14 Consumers problem

    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.
    Attached Files Attached Files

Similar Threads

  1. Replies: 16
    Last Post: 28th October 2008, 22:00
  2. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  3. Steps in solving a programming problem?
    By triperzonak in forum General Programming
    Replies: 8
    Last Post: 5th August 2008, 08:47
  4. QSemaphore: 1 Producer, 3 Consumers
    By Daedalus in forum Newbie
    Replies: 9
    Last Post: 1st April 2007, 20:59
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.