<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body><div><div style="font-family: Calibri,sans-serif; font-size: 11pt;">True, use cases beyond module installation can not be solved by instantiating SWMgr per thread. There is ticked on bug tracker related to this issue http://www.crosswire.org/tracker/browse/API-166<br><br>Blessings.</div></div><div dir="ltr"><hr><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">От: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;"><a href="mailto:greg.hellings@gmail.com">Greg Hellings</a></span><br><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">Отправлено: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;">11.01.2016 18:05</span><br><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">Кому: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;"><a href="mailto:sword-devel@crosswire.org">SWORD Developers' Collaboration Forum</a></span><br><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">Тема: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;">Re: [sword-devel] thread-safety in libsword?</span><br><br></div>The library has no guarantees of multi-threaded safety, so you'll need<br>to handle locking outside of the library.<br><br>Out of curiosity: what types of simultaneous/multi-threaded calls are<br>you performing? Some things can be parallelized by instantiating<br>multiple instances of SWMgr (e.g. this is how BibleTime used to<br>perform parallel downloads during module install).<br><br>--Greg<br><br>On Mon, Jan 11, 2016 at 6:52 AM, Teus Benschop <teusjannette@gmail.com> wrote:<br>> Hi,<br>><br>> When accessing libsword simultaneously from multiple threads, it often<br>> crashes. When surrounding the calls to the library with a mutex.lock and a<br>> mutex.unlock at the end, there's no crashes when accessing it in the same<br>> situation. I am seeing this on Linux and on the Mac. Should I do something<br>> in the library, or make a special call, to make it thread-safe? Or is<br>> surrounding the library calls with a mutex the recommended way to handle<br>> this?<br>><br>> Teus.<br>><br>> _______________________________________________<br>> sword-devel mailing list: sword-devel@crosswire.org<br>> http://www.crosswire.org/mailman/listinfo/sword-devel<br>> Instructions to unsubscribe/change your settings at above page<br><br>_______________________________________________<br>sword-devel mailing list: sword-devel@crosswire.org<br>http://www.crosswire.org/mailman/listinfo/sword-devel<br>Instructions to unsubscribe/change your settings at above page<br></body></html>