Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Issue with the thread
Forum Updated to NodeBB v4.3 + New Features

Issue with the thread

Scheduled Pinned Locked Moved Unsolved General and Desktop
21 Posts 5 Posters 2.9k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • kshegunovK kshegunov

    @Buckwheat said in Issue with the thread:

    Yes, the Qt::DirectConnection is a problem with threads.

    I object to that statement! I have a 5 years old or so C++ syntax parser that is threaded and uses direct connections exclusively. I would argue that one should know what Qt::DirectConnection implies, however. Same goes for Qt::QueuedConnection - just mindlessly using queued calls over whatever thread the objects happen to be in means you're just as mindlessly copying data around without a reason. What one should default to is the default - Qt::AutoConnection, and use a direct or a queued connection when and only when that's what is exactly, explicitly, supposed to happen.

    BuckwheatB Offline
    BuckwheatB Offline
    Buckwheat
    wrote on last edited by
    #21

    @kshegunov said in Issue with the thread:

    @kshegunov I am glad you take offense. But, the default behavior for connection seems to be queued connection when crossing thread boundaries. I have found NO exception to this in the last 7 years so obviously the Qt designers thought there might be a problem. This queuing is why you can Q_EMIT data from a thread and put it into a GUI control which can only be done from the main thread. Also, I just said "Qt::QueuedConnection is no problems with threads". I would assume he is using the defaults in his thread.

    As for copying, Sending a QSharedDataPointer is 4 bytes and is reference counted. NO COPYING except a pointer. Please read carefully before making "mindlessly" making judgements.

    As 99% of my posts say, it is all in your design. Know what you are doing and what protections are offered. If you need to queue packets, QSharedDataPointer is great and it manages the pointers properly.

    So, in summary, feel as offended as you like. It is a free forum and we can react how we like!

    Dave Fileccia

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved