incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Pevtsov" <Ant...@moscow.vdiweb.com>
Subject string methods thread safety
Date Mon, 03 Jul 2006 15:23:17 GMT
I updated the 21.string.push_back.mt 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:
http://people.apache.org/~antonp/stdcxx07032006/

I found the tricky place in the rwthread.cpp, line 397:
	void* const next_arg = thr_arg ? thr_arg + i : (void*)(thr_id +
i);
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
(http://mail-archives.apache.org/mod_mbox/incubator-stdcxx-dev/200605.mb
ox/%3c44692962.6040103@roguewave.com%3e) 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
replace()."
But as far as I see the begin method will fail the test if I didn't miss
something.

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?


Thanks,
Anton Pevtsov

Mime
View raw message