Re: Thread Safe Quantlib
Posted by
Luigi Ballabio on
Jun 10, 2016; 12:34pm
URL: http://quantlib.414.s1.nabble.com/Thread-Safe-Quantlib-tp17499p17510.html
Hello,
QuantLib is generally not thread-safe. The thread-local singleton pattern gives you per-thread singletons instead of global ones, but it doesn't prevent race conditions if you share objects between threads. The configure option --enable-thread-safe-observer-pattern was added because, when QuantLib is exported to C# or Java, the garbage collector would sometime cause a race with notifications in the library; the option prevents this, but it doesn't help with any of the other possible problems with caches or lazy calculations. I suggest to use multiple processes instead.
Luigi
hi
Has somebody tried using latest Quantlib 1.7 in multithreaded environment in C++?
Another web page at
talks about thread safety only with thread local singleton pattern.
I am slightly confused, is the latest version(1.7) thread safe without using thread local singleton patten? or do we still need to use the thread local singleton pattern.
Any other insights into thread safety would be greatly welcome.
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports.
https://ad.doubleclick.net/ddm/clk/305295220;132659582;e_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users