[sword-devel] thread-safety in libsword?

Konstantin Maslyuk kostyamaslyuk at gmail.com
Mon Jan 11 09:25:43 MST 2016


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

Blessings.

-----Исходное сообщение-----
От: "Greg Hellings" <greg.hellings �� gmail.com>
Отправлено: ‎11.‎01.‎2016 18:05
Кому: "SWORD Developers' Collaboration Forum" <sword-devel �� crosswire.org>
Тема: Re: [sword-devel] thread-safety in libsword?

The library has no guarantees of multi-threaded safety, so you'll need
to handle locking outside of the library.

Out of curiosity: what types of simultaneous/multi-threaded calls are
you performing? Some things can be parallelized by instantiating
multiple instances of SWMgr (e.g. this is how BibleTime used to
perform parallel downloads during module install).

--Greg

On Mon, Jan 11, 2016 at 6:52 AM, Teus Benschop <teusjannette �� gmail.com> wrote:
> Hi,
>
> When accessing libsword simultaneously from multiple threads, it often
> crashes. When surrounding the calls to the library with a mutex.lock and a
> mutex.unlock at the end, there's no crashes when accessing it in the same
> situation. I am seeing this on Linux and on the Mac. Should I do something
> in the library, or make a special call, to make it thread-safe? Or is
> surrounding the library calls with a mutex the recommended way to handle
> this?
>
> Teus.
>
> _______________________________________________
> sword-devel mailing list: sword-devel �� crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page

_______________________________________________
sword-devel mailing list: sword-devel �� crosswire.org
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page
----------- �������� ����� -----------
�������� � ������� HTML ���� ���������&hellip;
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20160111/46ebcfac/attachment.html>


More information about the sword-devel mailing list