<table><tr><td style="">davidedmundson 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><p>Kinda, you're summary missing a key part.<br />
(the commit description is a bit poor)</p>

<p>This patch does the following:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">It does the search in the other thread. That creates and iterates every possible device. This is expensive as there are lots of potential devices. We fetch pretty much everything udisks knows.</li>
</ul>

<ul class="remarkup-list">
<li class="remarkup-list-item">From the given list we recreate the select few devices that are relevant. This is relatively cheap. It does still block as you point out, but now for a much much smaller set of objects compared to before.</li>
</ul>

<p>(on my laptop that's 56 devices created when searching, resulting in 8 useful devices).</p>

<p>This is where the main thread saving is meant to come in.</p>

<p>As for dangling pointers. The private manager object dies as its backed by TLS. The device object itself does not. The device object has guards against a deleted manager internally. It won't crash, but will return "dead" values.</p>

<hr class="remarkup-hr" />

<p>You're absolutely right it's a hack around the current state, rather than a good long term direction. I'm not exactly loving it.<br />
I would love to rework solid to have a nice async api, and also to not use data engines. I'm not sure its doable within kf5.</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>