Results 1 to 4 of 4

Thread: QThread, QMutext - stability of application

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2009
    Location
    Poland, Cracow
    Posts
    34
    Thanks
    2
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default QThread, QMutext - stability of application

    Hello,

    As far as I found in Qt sources - when there is a problem with synchronization for threads, then only qWarning() is called.

    I wonder how should I handle my problem, since I need multi-threaded and stable application, but if I let threads to work even there are synchronization problems, then whole my application is going to crash or something...

    I know I can install message handler, but if I do so, then all warnings will be handled the same way and I don't think that synchronization problem is equal to some other, quiet trivial warning.

    Any hints what should I do?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QThread, QMutext - stability of application

    You should synchronize your application properly instead of relying on pure luck that no race conditions will occur.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2009
    Location
    Poland, Cracow
    Posts
    34
    Thanks
    2
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QThread, QMutext - stability of application

    But what if lock() (or similar method) fails because of operating system? Like resources, or something else. I don't remember all reasons to make pthreads fail, but I know there are some independent from developer.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QThread, QMutext - stability of application

    Quote Originally Posted by googie View Post
    But what if lock() (or similar method) fails because of operating system?
    What if your computer runs out of electicity?
    I think running out of the pool of semaphores is the slightest of possible problems. And QMutex::lock() itself should not fail as in 90% of the cases it will never call a real semaphore. Only when a real lock should occur a semaphore will be instantiated.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Deploying Qt 4.5.1 Application on RHEL 5.. Pls Help
    By swamyonline in forum Installation and Deployment
    Replies: 0
    Last Post: 28th June 2009, 11:43
  2. dll + application
    By fpujol in forum Qt Programming
    Replies: 11
    Last Post: 15th April 2007, 18:37

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.