multithreading prblm / 64bits linux

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

multithreading prblm / 64bits linux

moloko
Hi ,

I've got some issues with java using Quantlib via JNI:
during heaving load test we launch simultaneously several JNI function which are crashing on

 Is Rate discount_factor = marketcurve->discount(maturity,true);

does anyone knows if boost::shared_ptr<YieldTermStructure> marketcurve( is thread safe ?

I've found that boost::shared_ptr template is thread safe by default, but, the Makefile that comes with this software disables thread safety.
I'm using already compiled boost libraries, does someone knows if BOOST_DISABLE_THREADS is "on" in those libs ?

Another question which is maybe connected with the first one :
I'm compiling QL with
gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-9)
x86_64
on Linux RedHat enterprise Release 4 ( Nahan Update 6 )

If I do not want to be in bebug mode and to have a faster executing code, should I set the following option when executing ./configure ? : CXXFLAGS=' -O2 -m64'

If I omit -m64 could it lead to a core dump when executing the above-described test

Merci !

Pierre
Reply | Threaded
Open this post in threaded view
|

Re: multithreading prblm / 64bits linux

Luigi Ballabio
On Tue, 2008-04-29 at 07:29 -0700, moloko wrote:
> I've got some issues with java using Quantlib via JNI:
> during heaving load test we launch simultaneously several JNI function which
> are crashing on
>
>  Is Rate discount_factor = marketcurve->discount(maturity,true);
>
> does anyone knows if boost::shared_ptr<YieldTermStructure> marketcurve( is
> thread safe ?

Most probably not. It depends on the kind of curve you're using. If it's
a bootstrapped one, it's likely that your threads are trying to
bootstrap the same object at the same time. Of course, chaos ensues.

Luigi


--

Matz's Law:
A conclusion is the place where you got tired of thinking.



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: multithreading prblm / 64bits linux

moloko
Tks Luigi !

swap curves, so yes, bootstrapping

But I did not have this prblm with my old QL code ( 0.3.4 )

And my old QL code is running on a 32bits server. That's why I'm talking about
this subject also.

Pierre

Selon Luigi Ballabio <[hidden email]>:

> On Tue, 2008-04-29 at 07:29 -0700, moloko wrote:
> > I've got some issues with java using Quantlib via JNI:
> > during heaving load test we launch simultaneously several JNI function
> which
> > are crashing on
> >
> >  Is Rate discount_factor = marketcurve->discount(maturity,true);
> >
> > does anyone knows if boost::shared_ptr<YieldTermStructure> marketcurve( is
> > thread safe ?
>
> Most probably not. It depends on the kind of curve you're using. If it's
> a bootstrapped one, it's likely that your threads are trying to
> bootstrap the same object at the same time. Of course, chaos ensues.
>
> Luigi
>
>
> --
>
> Matz's Law:
> A conclusion is the place where you got tired of thinking.
>
>
>



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users