Re: [OpenSTA-devel] Re: When is Random not random?
Brought to you by:
dansut
|
From: Mark E. <ma...@bo...> - 2006-01-06 21:08:22
|
Wickersham, Peter wrote: > > In fact, there already is an issue with this code for REPEATABLE RANDOM > and that is the fact that we are using rand() in the first place. This > is a global function and the seed is a global, as well. So, if you want > more than one REPEATABLE RANDOM sequence, this won't work. I see what you mean, but if the two lines srand (_cur_seed); _cur_seed = rand(); were an atomic operation, wouldn't that take care of the problem as far as repeatable random is concerned? Then the #define VOREPRAND could be checked for in _options as to whether repeatable or otherwise (no srand() call) should be used. Or have I missed something obvious? Mark |