[ quantlib-Patches-3578375 ] thread-safe session handling using tss

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ quantlib-Patches-3578375 ] thread-safe session handling using tss

SourceForge.net
Patches item #3578375, was opened at 2012-10-19 05:48
Message generated for change (Tracker Item Submitted) made by rglarix
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=312740&aid=3578375&group_id=12740

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Riccardo Ghetta (rglarix)
Assigned to: Nobody/Anonymous (nobody)
Summary: thread-safe session handling using tss

Initial Comment:
QuantLib default session handling is thread safe only if you allocate all sessions beforehand, otherwise adding/removing a session id changes the map object potentially corrupting other thread iterators.
This patch uses boost::thread_specific_ptr to have a per-thread session id. Since the variable used is thread-private and inherently linked to the thread, no sessionId() method is needed.
The patch is enabled by defining QL_ENABLE_SESSIONS_TSS in config.hpp
Without the define QuantLib uses the old code.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=312740&aid=3578375&group_id=12740

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev