<html><head></head><body><div dir="auto">If you follow advice to have 1 InstallMgr instance per thread, it is perfectly thread safe. We don't try to allow multiple threads to begin installations of multiple modules using the same instance of an InstallMgr. Just new an InstallMgr for each parallel module installation you wish to start. If you are worried about your UI thread calling terminate on an InstallMgr in a worker thread, every SWORD frontend since time began does this. If you can imagine a scenario you could create which might in a million times fail (e.g. if (transport) [another thread finishes and destroys transport] transport->terminate()) and you actually think this is a practical concern worth adding to your UI, then take the advice in the comment and call terminate from your status update callback, which is called from the transport object itself assuring it will be true.</div><br><br><div class="gmail_quote"><div dir="auto">On August 5, 2024 09:33:20 GMT+02:00, Jaak Ristioja <jaak@ristioja.ee> wrote:</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail"><div dir="auto">On 04.08.24 22:49, Troy A. Griffitts wrote:<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"><div dir="auto">On 8/3/24 12:21 PM, Jaak Ristioja wrote:<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"><div dir="auto">Libsword does not well lend itself to certain tasks, and some are impossible. For example, there is still no reliable way for users to abort module installation/download in a thread-safe manner. Working around such libsword shortcomings without changing libsword is not worth the effort.<br></div></blockquote><div dir="auto"><br>Hi Jaak,<br><br>libsword provides for a thread to request termination of a transfer with InstallMgr::terminate():<br><br><a href="https://github.com/bibletime/crosswire-sword-mirror/blob/trunk/include/installmgr.h#L297-L301">https://github.com/bibletime/crosswire-sword-mirror/blob/trunk/include/installmgr.h#L297-L301</a><br></div></blockquote><div dir="auto"><br>Hi Troy,<br><br>Yes, but it is still not thread-safe:<br><br><br><a href="https://github.com/bibletime/crosswire-sword-mirror/blob/trunk/src/mgr/installmgr.cpp#L276">https://github.com/bibletime/crosswire-sword-mirror/blob/trunk/src/mgr/installmgr.cpp#L276</a><br><br><a href="https://github.com/bibletime/crosswire-sword-mirror/blob/trunk/include/remotetrans.h#L100">https://github.com/bibletime/crosswire-sword-mirror/blob/trunk/include/remotetrans.h#L100</a><br><br><a href="https://github.com/bibletime/crosswire-sword-mirror/blob/trunk/include/remotetrans.h#L62">https://github.com/bibletime/crosswire-sword-mirror/blob/trunk/include/remotetrans.h#L62</a><br><br><a href="https://github.com/bibletime/crosswire-sword-mirror/blob/trunk/src/mgr/remotetrans.cpp#L210">https://github.com/bibletime/crosswire-sword-mirror/blob/trunk/src/mgr/remotetrans.cpp#L210</a><br><br><br>Best regards,<br>Jaak Ristioja<hr>sword-devel mailing list: sword-devel@crosswire.org<br><a href="http://crosswire.org/mailman/listinfo/sword-devel">http://crosswire.org/mailman/listinfo/sword-devel</a><br>Instructions to unsubscribe/change your settings at above page<br></div></pre></blockquote></div><div dir="auto"><div class='k9mail-signature'>-- <br>Sent from my Android device with K-9 Mail. Please excuse my brevity.</div></div></body></html>