Using sessions it is possible to use QuantLib in a threaded program. This is obviously not an ideal solution and becomes very error prone if individual coders don't pay close attention to this. More importantly however, there are a few issues related to doing this:
1. Linking is a serious problem. You cannot use a shared library correctly since the sessionID function needs to be linked. Static libraries kind of work, until you have multiple shared libraries which wish to use QuantLib.
2. Session management is unclear. How can a session be cleaned up? If sessionId simply returns a thread id it means an endless number of sessions are created.
I'm not trying to be difficult, but point #1 is a critical issue for us. I have really struggled with both CMake and AutoMake to try and link the library correctly. Currently I'm stuck with automake on Fedora, it just can't resolve the sessionId symbol correctly when using transitive dependencies. I hope I can find a solution.
since I understand replacing sessions would be a significant fix, at least drop the need for the sessionId function. Instead have a library calls "createSession" , "setSession", and "deleteSession". This would clear up the linking problems and allow a dynamic library to be shared by multiple libraries at the same time.