Results 1 to 4 of 4

Thread: Multiple down/up with QSemaphore

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2008
    Location
    Brazil
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Multiple down/up with QSemaphore

    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.
    Last edited by diogolr; 5th April 2011 at 17:45. Reason: Changing the title

Similar Threads

  1. declare an array of QSemaphore and array of slot functions
    By radeberger in forum Qt Programming
    Replies: 11
    Last Post: 2nd May 2010, 14:24
  2. Problems with Qsemaphore and QThread
    By perseo in forum Qt Programming
    Replies: 2
    Last Post: 27th August 2008, 02:21
  3. Replies: 7
    Last Post: 26th July 2008, 14:24
  4. QSemaphore: 1 Producer, 3 Consumers
    By Daedalus in forum Newbie
    Replies: 9
    Last Post: 1st April 2007, 21:59
  5. Replies: 0
    Last Post: 21st December 2006, 12:48

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.