
Hi there, I have a number of threads and, within the context of each thread, a large number of objects may be active. I would now like to provide all objects accessed by a thread with a common random number generator. i.e., there would be as many random number generators as there are threads, and all objects active inside of a given thread would access the same generator, but objects in different threads use different generators. The obvious approach would be to store the generator in thread-local storage. I am concerned, however, about the performance implications. In particular, does access to thread-local storage implicitly involve locking of sorts? If so, the (very) frequent access to the random number generator would effectively serialize my application. Thanks and Best Regards, Beet