stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Pevtsov" <>
Subject string methods thread safety
Date Mon, 03 Jul 2006 15:23:17 GMT
I updated the test to use the test driver
features and extended it to exercise the append and replace methods in
the same way.
The test and required changes are here:

I found the tricky place in the rwthread.cpp, line 397:
	void* const next_arg = thr_arg ? thr_arg + i : (void*)(thr_id +
I suspect here should be
	void* const next_arg = thr_arg ? *(thr_arg + i) : (void*)(thr_id
+ i);
The fix included.

Also I have several questions.
1. The test becomes slow due to a huge amount of asserts to be verified.
I think that we should exercise the multithreading on several test cases
per eaach method, but shall we use all our char and allocator types for
this purpose?

2. Martin, you have mentioned
ox/ that
"We need to write thread safety tests for other member functions as well
(not necessarily all of them but at least those that we know are used a
lot. The most important ones are those that call _C_get_ref(), i.e., the
copy ctor, assignment operator, begin(), append(const string&), and
But as far as I see the begin method will fail the test if I didn't miss

3. The test looks useless in the single-threaded environment. May be we
should provide a stub for this cases and not run the test (or run and do
nothing) for these cases?

Anton Pevtsov

View raw message