quantlib multi-threading fix

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

quantlib multi-threading fix

SteveGe
There are some good fix for quantlib under multi-threading scenario. I am wondering why the fix not end up in quantlib library.
https://hpcquantlib.wordpress.com/2013/07/26/multi-threading-and-quantlib/
Reply | Threaded
Open this post in threaded view
|

Re: quantlib multi-threading fix

Klaus Spanderen-2
Hi
 
IMO the main reason is that this patch fixes one important multi-threading issue
expecially when using QuantLib in C#/Java, namely the Observer pattern. But the
modified Observer pattern implementation is based on boost::signals2 and
therefore comes with a performance penalty and the rest of the implemenation
needs a dirty trick via boost shared pointer debug hook to work.

Therefore I'd only recommend using the patch if you really need it and I'd
prefer to not "pollute" the official QL release.

regards
Klaus

> SteveGe <[hidden email]> hat am 21. Januar 2015 um 08:22 geschrieben:
>
>
> There are some good fix for quantlib under multi-threading scenario. I am
> wondering why the fix not end up in quantlib library.
> https://hpcquantlib.wordpress.com/2013/07/26/multi-threading-and-quantlib/
>
>
>
> --
> View this message in context:
> http://quantlib.10058.n7.nabble.com/quantlib-multi-threading-fix-tp16187.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> GigeNET is offering a free month of service with a new server in Ashburn.
> Choose from 2 high performing configs, both with 100TB of bandwidth.
> Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> http://p.sf.net/sfu/gigenet
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: quantlib multi-threading fix

SteveGe
It also fix the singleton pattern, it use thread local to fix it. We disable all Observer pattern but still experience singleton race condition.
Reply | Threaded
Open this post in threaded view
|

Re: quantlib multi-threading fix

Luigi Ballabio
In reply to this post by Klaus Spanderen-2
Klaus is right. However, we could kind of officially support it by adding the code as a branch on GitHub and keeping it up to date with master (if not continuously, at least every once in a while or after releases). Klaus, what do you think?

Luigi

On Thu, Jan 22, 2015 at 9:44 AM, Klaus Spanderen <[hidden email]> wrote:
Hi

IMO the main reason is that this patch fixes one important multi-threading issue
expecially when using QuantLib in C#/Java, namely the Observer pattern. But the
modified Observer pattern implementation is based on boost::signals2 and
therefore comes with a performance penalty and the rest of the implemenation
needs a dirty trick via boost shared pointer debug hook to work.

Therefore I'd only recommend using the patch if you really need it and I'd
prefer to not "pollute" the official QL release.

regards
Klaus

> SteveGe <[hidden email]> hat am 21. Januar 2015 um 08:22 geschrieben:
>
>
> There are some good fix for quantlib under multi-threading scenario. I am
> wondering why the fix not end up in quantlib library.
> https://hpcquantlib.wordpress.com/2013/07/26/multi-threading-and-quantlib/
>
>
>
> --
> View this message in context:
> http://quantlib.10058.n7.nabble.com/quantlib-multi-threading-fix-tp16187.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> GigeNET is offering a free month of service with a new server in Ashburn.
> Choose from 2 high performing configs, both with 100TB of bandwidth.
> Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> http://p.sf.net/sfu/gigenet
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



--

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: quantlib multi-threading fix

Klaus Spanderen-2
Hi Luigi,

sure, I'm happy to support the patch for the upcoming releases.

regards
Klaus

On Friday, January 23, 2015 10:03:21 AM Luigi Ballabio wrote:

> Klaus is right. However, we could kind of officially support it by adding
> the code as a branch on GitHub and keeping it up to date with master (if
> not continuously, at least every once in a while or after releases). Klaus,
> what do you think?
>
> Luigi
>
> On Thu, Jan 22, 2015 at 9:44 AM, Klaus Spanderen <[hidden email]> wrote:
> > Hi
> >
> > IMO the main reason is that this patch fixes one important multi-threading
> > issue
> > expecially when using QuantLib in C#/Java, namely the Observer pattern.
> > But the
> > modified Observer pattern implementation is based on boost::signals2 and
> > therefore comes with a performance penalty and the rest of the
> > implemenation
> > needs a dirty trick via boost shared pointer debug hook to work.
> >
> > Therefore I'd only recommend using the patch if you really need it and I'd
> > prefer to not "pollute" the official QL release.
> >
> > regards
> > Klaus
> >
> > > SteveGe <[hidden email]> hat am 21. Januar 2015 um 08:22
> >
> > geschrieben:
> > > There are some good fix for quantlib under multi-threading scenario. I
> > > am
> > > wondering why the fix not end up in quantlib library.
> >
> > https://hpcquantlib.wordpress.com/2013/07/26/multi-threading-and-quantlib/
> >
> > > --
> >
> > > View this message in context:
> > http://quantlib.10058.n7.nabble.com/quantlib-multi-threading-fix-tp16187.h
> > tml>
> > > Sent from the quantlib-users mailing list archive at Nabble.com.
> >
> > --------------------------------------------------------------------------
> > ---->
> > > New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> > > GigeNET is offering a free month of service with a new server in
> > > Ashburn.
> > > Choose from 2 high performing configs, both with 100TB of bandwidth.
> > > Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> > > http://p.sf.net/sfu/gigenet
> > > _______________________________________________
> > > QuantLib-users mailing list
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/quantlib-users
> >
> > --------------------------------------------------------------------------
> > ---- New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> > GigeNET is offering a free month of service with a new server in Ashburn.
> > Choose from 2 high performing configs, both with 100TB of bandwidth.
> > Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> > http://p.sf.net/sfu/gigenet
> > _______________________________________________
> > QuantLib-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/quantlib-users


------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: quantlib multi-threading fix

Luigi Ballabio
Hi Klaus,
     I've seen you posted the patch for 1.5 on your blog.  Do you have it as a branch on your repo, too? If so, I'd pull it into mine.

Luigi

On Sat, Jan 24, 2015 at 12:51 PM, Klaus Spanderen <[hidden email]> wrote:
Hi Luigi,

sure, I'm happy to support the patch for the upcoming releases.

regards
Klaus

On Friday, January 23, 2015 10:03:21 AM Luigi Ballabio wrote:
> Klaus is right. However, we could kind of officially support it by adding
> the code as a branch on GitHub and keeping it up to date with master (if
> not continuously, at least every once in a while or after releases). Klaus,
> what do you think?
>
> Luigi
>
> On Thu, Jan 22, 2015 at 9:44 AM, Klaus Spanderen <[hidden email]> wrote:
> > Hi
> >
> > IMO the main reason is that this patch fixes one important multi-threading
> > issue
> > expecially when using QuantLib in C#/Java, namely the Observer pattern.
> > But the
> > modified Observer pattern implementation is based on boost::signals2 and
> > therefore comes with a performance penalty and the rest of the
> > implemenation
> > needs a dirty trick via boost shared pointer debug hook to work.
> >
> > Therefore I'd only recommend using the patch if you really need it and I'd
> > prefer to not "pollute" the official QL release.
> >
> > regards
> > Klaus
> >
> > > SteveGe <[hidden email]> hat am 21. Januar 2015 um 08:22
> >
> > geschrieben:
> > > There are some good fix for quantlib under multi-threading scenario. I
> > > am
> > > wondering why the fix not end up in quantlib library.
> >
> > https://hpcquantlib.wordpress.com/2013/07/26/multi-threading-and-quantlib/
> >
> > > --
> >
> > > View this message in context:
> > http://quantlib.10058.n7.nabble.com/quantlib-multi-threading-fix-tp16187.h
> > tml>
> > > Sent from the quantlib-users mailing list archive at Nabble.com.
> >
> > --------------------------------------------------------------------------
> > ---->
> > > New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> > > GigeNET is offering a free month of service with a new server in
> > > Ashburn.
> > > Choose from 2 high performing configs, both with 100TB of bandwidth.
> > > Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> > > http://p.sf.net/sfu/gigenet
> > > _______________________________________________
> > > QuantLib-users mailing list
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/quantlib-users
> >
> > --------------------------------------------------------------------------
> > ---- New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> > GigeNET is offering a free month of service with a new server in Ashburn.
> > Choose from 2 high performing configs, both with 100TB of bandwidth.
> > Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> > http://p.sf.net/sfu/gigenet
> > _______________________________________________
> > QuantLib-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/quantlib-users




--

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: quantlib multi-threading fix

Klaus Spanderen-2
Hi,

at the time being the patch is not on github. I'll catch up and send you an
"invite".

regards
Klaus

On Friday, March 06, 2015 11:47:25 AM Luigi Ballabio wrote:

> Hi Klaus,
>      I've seen you posted the patch for 1.5 on your blog.  Do you have it
> as a branch on your repo, too? If so, I'd pull it into mine.
>
> Luigi
>
> On Sat, Jan 24, 2015 at 12:51 PM, Klaus Spanderen <[hidden email]>
>
> wrote:
> > Hi Luigi,
> >
> > sure, I'm happy to support the patch for the upcoming releases.
> >
> > regards
> > Klaus
> >
> > On Friday, January 23, 2015 10:03:21 AM Luigi Ballabio wrote:
> > > Klaus is right. However, we could kind of officially support it by
> > > adding
> > > the code as a branch on GitHub and keeping it up to date with master (if
> > > not continuously, at least every once in a while or after releases).
> >
> > Klaus,
> >
> > > what do you think?
> > >
> > > Luigi
> > >
> > > On Thu, Jan 22, 2015 at 9:44 AM, Klaus Spanderen <[hidden email]>
> >
> > wrote:
> > > > Hi
> > > >
> > > > IMO the main reason is that this patch fixes one important
> >
> > multi-threading
> >
> > > > issue
> > > > expecially when using QuantLib in C#/Java, namely the Observer
> > > > pattern.
> > > > But the
> > > > modified Observer pattern implementation is based on boost::signals2
> >
> > and
> >
> > > > therefore comes with a performance penalty and the rest of the
> > > > implemenation
> > > > needs a dirty trick via boost shared pointer debug hook to work.
> > > >
> > > > Therefore I'd only recommend using the patch if you really need it and
> >
> > I'd
> >
> > > > prefer to not "pollute" the official QL release.
> > > >
> > > > regards
> > > > Klaus
> > > >
> > > > > SteveGe <[hidden email]> hat am 21. Januar 2015 um 08:22
> > > >
> > > > geschrieben:
> > > > > There are some good fix for quantlib under multi-threading scenario.
> >
> > I
> >
> > > > > am
> > > > > wondering why the fix not end up in quantlib library.
> >
> > https://hpcquantlib.wordpress.com/2013/07/26/multi-threading-and-quantlib/
> >
> > > > > --
> >
> > > > > View this message in context:
> > http://quantlib.10058.n7.nabble.com/quantlib-multi-threading-fix-tp16187.h
> >
> > > > tml>
> > > >
> > > > > Sent from the quantlib-users mailing list archive at Nabble.com.
> >
> > --------------------------------------------------------------------------
> >
> > > > ---->
> > > >
> > > > > New Year. New Location. New Benefits. New Data Center in Ashburn,
> > > > > VA.
> > > > > GigeNET is offering a free month of service with a new server in
> > > > > Ashburn.
> > > > > Choose from 2 high performing configs, both with 100TB of bandwidth.
> > > > > Higher redundancy.Lower latency.Increased capacity.Completely
> >
> > compliant.
> >
> > > > > http://p.sf.net/sfu/gigenet
> > > > > _______________________________________________
> > > > > QuantLib-users mailing list
> > > > > [hidden email]
> > > > > https://lists.sourceforge.net/lists/listinfo/quantlib-users
> >
> > --------------------------------------------------------------------------
> >
> > > > ---- New Year. New Location. New Benefits. New Data Center in Ashburn,
> >
> > VA.
> >
> > > > GigeNET is offering a free month of service with a new server in
> >
> > Ashburn.
> >
> > > > Choose from 2 high performing configs, both with 100TB of bandwidth.
> > > > Higher redundancy.Lower latency.Increased capacity.Completely
> >
> > compliant.
> >
> > > > http://p.sf.net/sfu/gigenet
> > > > _______________________________________________
> > > > QuantLib-users mailing list
> > > > [hidden email]
> > > > https://lists.sourceforge.net/lists/listinfo/quantlib-users




------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: quantlib multi-threading fix

Luigi Ballabio
Ok, thanks. There's no need to invite me to your repo, though. As long as the changes are in a branch on GitHub I can set your repo as a remote and pull from it.

Luigi

On Tue, Mar 10, 2015 at 10:21 PM, Klaus Spanderen <[hidden email]> wrote:
Hi,

at the time being the patch is not on github. I'll catch up and send you an
"invite".

regards
Klaus

On Friday, March 06, 2015 11:47:25 AM Luigi Ballabio wrote:
> Hi Klaus,
>      I've seen you posted the patch for 1.5 on your blog.  Do you have it
> as a branch on your repo, too? If so, I'd pull it into mine.
>
> Luigi
>
> On Sat, Jan 24, 2015 at 12:51 PM, Klaus Spanderen <[hidden email]>
>
> wrote:
> > Hi Luigi,
> >
> > sure, I'm happy to support the patch for the upcoming releases.
> >
> > regards
> > Klaus
> >
> > On Friday, January 23, 2015 10:03:21 AM Luigi Ballabio wrote:
> > > Klaus is right. However, we could kind of officially support it by
> > > adding
> > > the code as a branch on GitHub and keeping it up to date with master (if
> > > not continuously, at least every once in a while or after releases).
> >
> > Klaus,
> >
> > > what do you think?
> > >
> > > Luigi
> > >
> > > On Thu, Jan 22, 2015 at 9:44 AM, Klaus Spanderen <[hidden email]>
> >
> > wrote:
> > > > Hi
> > > >
> > > > IMO the main reason is that this patch fixes one important
> >
> > multi-threading
> >
> > > > issue
> > > > expecially when using QuantLib in C#/Java, namely the Observer
> > > > pattern.
> > > > But the
> > > > modified Observer pattern implementation is based on boost::signals2
> >
> > and
> >
> > > > therefore comes with a performance penalty and the rest of the
> > > > implemenation
> > > > needs a dirty trick via boost shared pointer debug hook to work.
> > > >
> > > > Therefore I'd only recommend using the patch if you really need it and
> >
> > I'd
> >
> > > > prefer to not "pollute" the official QL release.
> > > >
> > > > regards
> > > > Klaus
> > > >
> > > > > SteveGe <[hidden email]> hat am 21. Januar 2015 um 08:22
> > > >
> > > > geschrieben:
> > > > > There are some good fix for quantlib under multi-threading scenario.
> >
> > I
> >
> > > > > am
> > > > > wondering why the fix not end up in quantlib library.
> >
> > https://hpcquantlib.wordpress.com/2013/07/26/multi-threading-and-quantlib/
> >
> > > > > --
> >
> > > > > View this message in context:
> > http://quantlib.10058.n7.nabble.com/quantlib-multi-threading-fix-tp16187.h
> >
> > > > tml>
> > > >
> > > > > Sent from the quantlib-users mailing list archive at Nabble.com.
> >
> > --------------------------------------------------------------------------
> >
> > > > ---->
> > > >
> > > > > New Year. New Location. New Benefits. New Data Center in Ashburn,
> > > > > VA.
> > > > > GigeNET is offering a free month of service with a new server in
> > > > > Ashburn.
> > > > > Choose from 2 high performing configs, both with 100TB of bandwidth.
> > > > > Higher redundancy.Lower latency.Increased capacity.Completely
> >
> > compliant.
> >
> > > > > http://p.sf.net/sfu/gigenet
> > > > > _______________________________________________
> > > > > QuantLib-users mailing list
> > > > > [hidden email]
> > > > > https://lists.sourceforge.net/lists/listinfo/quantlib-users
> >
> > --------------------------------------------------------------------------
> >
> > > > ---- New Year. New Location. New Benefits. New Data Center in Ashburn,
> >
> > VA.
> >
> > > > GigeNET is offering a free month of service with a new server in
> >
> > Ashburn.
> >
> > > > Choose from 2 high performing configs, both with 100TB of bandwidth.
> > > > Higher redundancy.Lower latency.Increased capacity.Completely
> >
> > compliant.
> >
> > > > http://p.sf.net/sfu/gigenet
> > > > _______________________________________________
> > > > QuantLib-users mailing list
> > > > [hidden email]
> > > > https://lists.sourceforge.net/lists/listinfo/quantlib-users




------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



--

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users