|
Hi,
This may be a repeat email as my first version was submitted before I had
successfully registered. If this is the case, I apologise.
I'm looking at producing a .NET server which serves requests for financial
functions. These requests may come via Web services, Remoting, COM+ or
direct calls. The direct calls can be C++, .NET, COM or java clients. These
calls are then forwarded to the QuantLib engine for processing.
Now the only snag here are the 3 Singleton classes that you guys employ.
ExchangeRateManager, IndexManager and Settings.
For both the Settings class and IndexManager class especially , if more than
one request enters a multi-threaded server .NET or C++ where 2 users have
already constructed yieldcurves of two different calculcation dates, they
would like to process these request using their own calculation date.
Although within Quantlib you can set this via the evaluationDate() function,
this is global to the library and thus any change that userA may do may well
be undone by userB, thus invalidating the result that userA would calculate.
Worst still, no error will be reported.
Do you guys have a suggestion for this multi-user usage?
I failed to see how QuantLib can be used within any multi-threaded,
multi-usage scenario if there are global variables like these (unless you
constrain the library for single user use (like Excel only, WinApp only),
yuck!!).
For example, for missed fixing of floating rate coupons, how would the
library know which user has set the fixings?
For all other objects, you can easily employ either a map or a DB for
holding all user object information, but not for these 3 static classes, you
would have to block the whole library during a call that utilises any of
these 3 static objects.
Best Regards,
Toyin Akin.
|