RE: Quantlib within a multithreaded architecture.

Posted by Toyin Akin on
URL: http://quantlib.414.s1.nabble.com/ANN-QuantLib-0-3-7-released-tp3088p3094.html

Hi Ferdinando,

I'm not against the threading idea, I was just wondering why the change of
design from a local TodaysDate where you had more flexibility of computing
individual Theta components to the global evalDate() functionality. This to
me was a simpler solution to implement than the threading one.

A classic example of this is finding the theta due to discounting cashflows
only (with fixing rates and volatility values unchanged). Or theta due to
fixing rates (vols and discounting remaining constant).

It seemed to me that by changing all the object's TodaysDate you can also
find the global Theta change.

However I agree with you that you can get a more accurate Theta from a
global change because you do not need to track every occurance of where
Theta has an effect, however you lose the local theta flexability.

Because of this funnny global theta-ness it does make sense now to have a
global date parameter (in order to make sure you capture the sum of all
theta components), but only local to the set of objects which are to be
effected by it. From the solution Luigi has proposed (same ID for the
related objects), this seems possible.

Again the 'local thread storage' may be an issue, I read somewhere that it
is an very precious resource and thus within a multiuser environment with
hundreds of users each creating many objects, I'm too too sure if it is
scalable, but I'm not an expert on C++ threading!!

Best Regards,

Toy out.

>From: Ferdinando Ametrano <[hidden email]>
>To: "Toyin Akin" <[hidden email]>
>CC: QuantLib-users <[hidden email]>
>Subject: RE: [Quantlib-users] Quantlib within a multithreaded  
>architecture.
>Date: Sat, 10 Sep 2005 16:45:02 +0200
>
>Hi Toyin
>
>>I seem to remember that there was an explicit Today's Date parameter
>>associated with the Yieldcurve object within QuantLib 0.3.7.
>
>right
>
>>Thus you had a local Today's Date associated with the yieldCurve. Need to
>>compute Theta? No problem, shift the date within the YieldCurve. No side
>>effects on other functions or fancy threading.
>>Why did this TodaysDate parameter vanish from earlier versions of
>>QuantLib?
>
>one of the reason YieldCurve's TodaysDate disappeared is exactly to have a
>more robust day-theta, that is you shift TodaysDate in the Settings and
>you'll get the whole effect of day-shifting, including any possible
>contributions from those objects you didn't know you had a theta dependence
>from
>
>As for the threading problem: Luigi's proposal sounds very very good to me.
>
>ciao -- Nando
>
>
>--
>No virus found in this outgoing message.
>Checked by AVG Anti-Virus.
>Version: 7.0.344 / Virus Database: 267.10.21/96 - Release Date: 9/10/2005
>
>