Results 1 to 2 of 2

Thread: yet another multithreading example request

  1. #1
    Join Date
    Sep 2010
    Posts
    12
    Qt products
    Platforms
    Unix/X11

    Default yet another multithreading example request

    hi!
    i am not an experienced programmer and
    i´m going to develop a computer vision application and i have to write an application where:
    1) a capture thread get an image from camera or from video file and put it in a buffer
    2) a process thread get the image from buffer and process it

    so it is a simple consumer/producer problem.. with a shared buffer.

    even if i have some experience with c++ programming in computer vision i have never done anything with multi threading. i have read about qthread, qmutex, qsemaphore, qwaitconditions.. and everything is a big mess.
    i don t understand where i have to use qmutex and where qsemaphore or where to use qwaitcondition and if i have to put toghether the threading system with signal and slots.. an real hell.
    i´ve tried to do something but i have created a little program where after click ´run´ everything is blocking and nothing is shown.

    multithreading is not my first target, because i have to handle some computer vision problem, so i want to spent less time possibile in it and focus on the real problem (the computer vision algorithm).
    i´m looking for a simple example to do something like this.

    i don´t need some sofisticated solution. only a processing thread that elaborate an image as soon as the buffer has it and. with the possibility of set the buffer capacity (only before starting) and the possibility to decide if the buffer is full what to do: drop the new frame from camera of drom the oldest frames in the buffer.

    sorry if i repeat myself: i have to handle computer vision problem and threading is not my proble, i would spend in it as less time possible.
    i just need something that can process heavy algorithm without blocking the gui and the video source

    can someone point me to an already done example that do something similar?

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: yet another multithreading example request

    I hope you know how to get th Qt Docs and refer the examples there, any way here is simple example in Qt Centre Wiki http://www.qtcentre.org/wiki/index.p...I_from_QThread
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

Similar Threads

  1. When to use Multithreading?
    By "BumbleBee" in forum General Programming
    Replies: 5
    Last Post: 30th April 2011, 18:21
  2. Request ID of QNetworkaccessmanager get and post request
    By dineshkumar in forum Qt Programming
    Replies: 2
    Last Post: 4th February 2011, 21:56
  3. multithreading
    By mickey in forum General Programming
    Replies: 2
    Last Post: 5th June 2008, 22:01
  4. MultiThreading in Qt
    By manivannan_1984 in forum Qt Programming
    Replies: 7
    Last Post: 7th November 2006, 19:26
  5. Qhttp::request(...) method and GET request
    By mikhailt in forum Qt Programming
    Replies: 4
    Last Post: 15th September 2006, 12:26

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.