This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
Peter Dimov wrote:In addition to your test, you might consider something along the lines of
http://www.boost.org/libs/smart_ptr/test/weak_ptr_mt_test.cpp
It's still a probabilistic approach, but with a slightly better coverage of the possible races.
I've had a look at this now; looks like a good idea. However, I was under the impression that rand() wasn't thread safe as it maintains internal state?
/* POSIX.1c requires that there is mutual exclusion for the `rand' and `srand' functions to prevent concurrent calls from modifying common data. */
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |