{"id":2735,"date":"2022-08-30T15:27:20","date_gmt":"2022-08-30T15:27:20","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/02\/08\/how-to-start-a-few-qprocess-in-parallel-and-block-until-all-of-them-have-exited-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:27:20","modified_gmt":"2022-08-30T15:27:20","slug":"how-to-start-a-few-qprocess-in-parallel-and-block-until-all-of-them-have-exited-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/how-to-start-a-few-qprocess-in-parallel-and-block-until-all-of-them-have-exited-collection-of-common-programming-errors\/","title":{"rendered":"How to start a few QProcess in parallel and block until all of them have exited?-Collection of common programming errors"},"content":{"rendered":"<p>If you connect all of the finished() signals to a single object living in the main thread, you don&#8217;t need to worry about protecting the counter. Each signal will get queued and processed in turn in the main thread. Just make sure you use a Qt::QueuedConnection when you connect.<\/p>\n<p>Amartel is correct about checking to make sure they launch before letting them run.<\/p>\n<p><strong>Edit:<\/strong> As mentioned here (Is QProcess::finished emitted when process crashes in Qt?), you might consider connecting to the error() signal as well.<\/p>\n<p id=\"rop\"><small>Originally posted 2014-02-08 15:44:29. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>If you connect all of the finished() signals to a single object living in the main thread, you don&#8217;t need to worry about protecting the counter. Each signal will get queued and processed in turn in the main thread. Just make sure you use a Qt::QueuedConnection when you connect. Amartel is correct about checking to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2735","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2735","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2735"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2735\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2735"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2735"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2735"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}