QuantLib-SWIG Patch for JVM/.NET Languages

Update 23.11.2015: The latest version is now part of the official QuantLib Release 1.7.

Update 22.09.2015: Please find the latest and improved version of the patch for QuantLib 1.6.2 here.

The usage of QuantLib in JVM and .NET languages (e.g. Java/Scala and C#/F#) via the SWIG interface has a known shortcoming. The implementation of QuantLib’s observer pattern does not tolerate a parallel garbage collector running in a different thread. As a result programs are randomly crashing or producing “pure virtual function calls”. A detailed description of this problem can be found e.g. here and within the references.

Please find here a patch for QuantLib 1.4 to fix this issue. It contains

Installation instructions are included in the readme.txt file.


4 thoughts on “QuantLib-SWIG Patch for JVM/.NET Languages

  1. Hi Klaus, with the current trunk the markov tests should run reasonably fast again, so I guess starting with 1.5 you can include them in your patch again. Best, Peter

  2. Hi Klaus, I know memory management in python works differently than JVM/.Net VM but I was wondering if this solution would also work as thread-safe solution via Swig-Python? Perhaps there are certain parts of the patch which would not be needed? Regards, Joe

    • Hi Joe,

      The patch should work for Python as well because (I guess) the Python interpreter uses the same OS threads as the boost library. IMO you don’t need the patch for Python 2.x.

      You’ll need all parts of the patch.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s