I suppose it's logical to have Settings as a Singleton (it is a static variable??) in a single-threaded application and if it is read-only it will not lead to a race condition in MT. If not, some choices are:. Make a copy per thread (thread-local storage).. Make it thread-safe (how often is it accessed?). Singleton is not thread-safe. You can put mutexes around the access code in Singleton.. Design functions as thread start functions, each with its own settings.Ideally, no shared data between threads. Otherwise, one can use shared data pattern
http://my.safaribooksonline.com/book/so ... 05lev1sec8 I wonder what the influence is of shared ptrs is on thread-safeness. Global data and MT are considered harmful? QuoteYes, that's what we do, too. In our case though, we have to do this for thousands of instruments, so it becomes attractive to do multiprocess (if you spawn jobs with hundreds or thousands of instruments, the setup cost becomes negligible).(Heavyweight) process have no shared data by default; is it not better to use threads with work-stealing and loop-level parallelism? QuoteI forgot to mention that one big reason I would need to change the settlement date is so that I can calculate a theta for an option. I am doing a simple numerical derivative to calculate the theta since the binomial, discrete dividend model is unable to do so. I don't know how to do this without changing the settlement date.What about FD? The price at levels n, n+1 have already been computed. Maybe run two binomial method at t_now and t_now + delta_t and add the results?