<table><tr><td style="">bruns added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D22333">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #8C98B8;
          color: #6B748C;
          font-style: italic;
          margin: 4px 0 12px 0;
          padding: 8px 12px;
          background-color: #F8F9FC;">
<div style="font-style: normal;
          padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D22333#494852" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">D22333#494852</a>, <a href="https://phabricator.kde.org/p/anthonyfieroni/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@anthonyfieroni</a> wrote:</div>
<div style="margin: 0;
          padding: 0;
          border: 0;
          color: rgb(107, 116, 140);"><p><a href="https://phabricator.kde.org/source/solid/browse/master/src/solid/devices/frontend/devicemanager.cpp$301" class="remarkup-link" target="_blank" rel="noreferrer">https://phabricator.kde.org/source/solid/browse/master/src/solid/devices/frontend/devicemanager.cpp$301</a><br />
 <a href="https://phabricator.kde.org/p/bruns/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@bruns</a>, It's backend per thread</p></div>
</blockquote>

<p>Yes, you are correct, so there are no threading issues, sorry.</p>

<p>On the other hand, this IMHO makes this approach even less profitable:</p>

<ol class="remarkup-list">
<li class="remarkup-list-item">every backend is initialized once from the two helpers (assuming both dataengines are used).</li>
<li class="remarkup-list-item">after the threads finish, all but the relevant UDIs are thrown away (and care must be taken not to use anything else - the devices would be dangling pointers in the now gone thread storage)</li>
<li class="remarkup-list-item">the first completing thread triggers the initialization of the backends again - in the main thread.</li>
</ol>

<p>As the initialization happens implicitly by the Device instantiation, for e.g. UDisks there are two synchronous DBus calls now, one for introspection from the manager backend and one for the device itself from the device backend. Both are done in the main thread, and we will block even longer.</p>

<p>So any gain here is AFAICS from the fact the constructor no longer blocks on a DBus call.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R120 Plasma Workspace</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D22333">https://phabricator.kde.org/D22333</a></div></div><br /><div><strong>To: </strong>apol, Plasma, davidedmundson, bruns<br /><strong>Cc: </strong>anthonyfieroni, bruns, plasma-devel, LeGast00n, jraleigh, fbampaloukas, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>