Thread safety

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Thread safety

Dagur Gunnarsson-2
hello,

I am creating an erlang library in C++ which uses Quantlib to do bonds calculation.  Erlang is highly concurrent programming language, and we have had some problems with the code crashing at random places.
After some investigation my suspicion is that QuantLib is not thread-safe and my question is whether some one on the mailing-list has any experience with using QuantLib in a multi-thread environment?

regards
Dagur G

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Thread safety

Bojan Nikolic

Hi Dagur,

I do not think QuantLib is thread-safe. Parallel implementations using
Quantlib that I am aware of are based on the multi-processes
message-passing model. The structure of instrument portfolios and the
way scenarios are priced means that this is often quite efficient.

Best,
Bojan

--
Bojan Nikolic          ||          http://www.bnikolic.co.uk/ql

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Thread safety

japari
Sure its not, for instance, have a look at LazyObject::calculate. This one will bite you for sure; LazyObject is quite low in QL's food-chain...everything is Lazy. In this case you might rewrite 'calculate' and lock there (you can lock, call parents 'calculate' and unlock).
But thats ok for one-shot/cached calculations; observability is another story. And... I havent worried about exceptions.... :-(
If you can, prefer distributed as Bojan points out.
Best
Pepe


----- Mail original -----
De: "Bojan Nikolic" <[hidden email]>
À: "Dagur Gunnarsson" <[hidden email]>
Cc: [hidden email]
Envoyé: Lundi 20 Février 2012 16:08:33
Objet: Re: [Quantlib-users] Thread safety


Hi Dagur,

I do not think QuantLib is thread-safe. Parallel implementations using
Quantlib that I am aware of are based on the multi-processes
message-passing model. The structure of instrument portfolios and the
way scenarios are priced means that this is often quite efficient.

Best,
Bojan

--
Bojan Nikolic          ||          http://www.bnikolic.co.uk/ql

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users