arabica icon indicating copy to clipboard operation
arabica copied to clipboard

Arabica crashes randomly in multi threaded environments

Open stonemaster opened this issue 11 years ago • 2 comments

Arabica is not thread safe even when used with objects that aren't shared. The problem lies in the boost Spirit classic Api which can't be used safely in multi threading environments (see https://svn.boost.org/trac/boost/ticket/5520). The problem can be easily reproduced by creating several threads which either compile Xpath expressions or parse XML in distinct objects. It seems that only switching to Boost Spirit V2 solves the problem.

stonemaster avatar Dec 16 '13 18:12 stonemaster

It's easy to fix by adding BOOST_SPIRIT_THREADSAFE before inclusion of arabica headers (See "Reentrancy and multithreading" at http://www.boost.org/doc/libs/1_35_0/libs/spirit/doc/grammar.html). This will require that Boost.Thread should be linked in addition to other libraries...

P.S. Andre - we can discuss this after I back to work :-)

alexott avatar Dec 24 '13 16:12 alexott

Thanks Alex, and Happy New Year!

I think I can make the necessary changes in the configure script - I'll work up the changes when I get the chance - but it sounds like you can handle it locally until whenever that is.

jezhiggins avatar Dec 27 '13 10:12 jezhiggins