Issue Details (XML | Word | Printable)

Key: STDCXX-536
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Travis Vitek
Reporter: Martin Sebor
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
C++ Standard Library

allow thread safety tests to time out without failing

Created: 25/Aug/07 01:44 AM   Updated: 29/May/08 11:37 PM
Return to search
Component/s: Tests
Affects Version/s: 4.2.0
Fix Version/s: 4.2.2

Time Tracking:
Original Estimate: 3h
Original Estimate - 3h
Remaining Estimate: 0h
Time Spent - 5h
Time Spent: 5h
Time Spent - 5h

File Attachments:
  Size
Text File Licensed for inclusion in ASF works stdcxx-536.patch 2008-05-07 08:45 PM Travis Vitek 49 kB

Severity: Usability
Resolution Date: 29/May/08 11:37 PM


 Description  « Hide
The newly added thread safety tests (and possibly some of the existing ones) tend to run for a long time, consuming a lot of CPU cycles, and sometimes even failing due to a timeout (currently 300 seconds in nightly builds). It would be useful to provide a mechanism such as a command line option whereby the tests' runtime could be limited without necessarily causing them to fail when the amount of time is exceeded. One way to do it would be for each test to set an alarm in response to this command line option and in handler for the alarm set a flag that each thread would check at each iteration of its loop to see if it should break.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #655960 Tue May 13 18:21:50 UTC 2008 vitek 2008-05-07 Travis Vitek <vitek@roguewave.com>

STDCXX-536
* tests/include/rw_thread.h (rw_thread_pool): Add timeout
parameter with default value.
(rw_thread_pool_timeout_expired): New function declaration.
* tests/src/thread.cpp: (_rw_timeout_handler): New function
to respond to alarm signals and set timeout flag.
(rw_thread_pool_timeout_expired): New function to query
timeout status.
(rw_thread_pool): Set alarm based on timeout value provided.
* tests/localization/22.locale.codecvt.mt.cpp: Add timeout
option with default value. Poll rw_thread_pool_time_expired()
in thread function and respond.
* tests/localization/22.locale.cons.mt.cpp: Ditto.
* tests/localization/22.locale.ctype.mt.cpp: Ditto.
* tests/localization/22.locale.globals.mt.cpp: Ditto.
* tests/localization/22.locale.messages.mt.cpp: Ditto.
* tests/localization/22.locale.money.get.mt.cpp: Ditto.
* tests/localization/22.locale.money.put.mt.cpp: Ditto.
* tests/localization/22.locale.moneypunct.mt.cpp: Ditto.
* tests/localization/22.locale.num.get.mt.cpp: Ditto.
* tests/localization/22.locale.num.put.mt.cpp: Ditto.
* tests/localization/22.locale.numpunct.mt.cpp: Ditto.
* tests/localization/22.locale.statics.mt.cpp: Ditto.
* tests/localization/22.locale.time.get.mt.cpp: Ditto.
* tests/localization/22.locale.time.put.mt.cpp: Ditto.
Files Changed
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.money.get.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/src/thread.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.num.put.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.statics.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.money.put.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.moneypunct.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.ctype.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.time.get.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.numpunct.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.cons.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.codecvt.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.time.put.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.globals.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.messages.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/include/rw_thread.h
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.num.get.mt.cpp

Repository Revision Date User Message
ASF #655995 Tue May 13 20:25:51 UTC 2008 vitek 2008-05-13 Travis Vitek <vitek@roguewave.com>

STDCXX-536
* tests/localization/22.locale.codecvt.mt.cpp: Pass
opt_timeout to rw_thread_pool() to enable timeouts.
* tests/localization/22.locale.cons.mt.cpp: Ditto.
* tests/localization/22.locale.ctype.mt.cpp: Ditto.
* tests/localization/22.locale.globals.mt.cpp: Ditto.
* tests/localization/22.locale.messages.mt.cpp: Ditto.
* tests/localization/22.locale.money.get.mt.cpp: Ditto.
* tests/localization/22.locale.money.put.mt.cpp: Ditto.
* tests/localization/22.locale.moneypunct.mt.cpp: Ditto.
* tests/localization/22.locale.num.get.mt.cpp: Ditto.
* tests/localization/22.locale.num.put.mt.cpp: Ditto.
* tests/localization/22.locale.numpunct.mt.cpp: Ditto.
* tests/localization/22.locale.statics.mt.cpp: Ditto.
* tests/localization/22.locale.time.get.mt.cpp: Ditto.
* tests/localization/22.locale.time.put.mt.cpp: Ditto.
Files Changed
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.time.get.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.money.get.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.numpunct.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.num.put.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.cons.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.statics.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.codecvt.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.time.put.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.money.put.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.globals.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.messages.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.num.get.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.moneypunct.mt.cpp
MODIFY /stdcxx/branches/4.2.x/tests/localization/22.locale.ctype.mt.cpp

Repository Revision Date User Message
ASF #660350 Tue May 27 01:51:19 UTC 2008 sebor 2008-05-26 Martin Sebor <sebor@roguewave.com>

Merged revs 654288, 658434, 653946, 658425, 659155, 659199,
656914, 654288, 653279, 655960, 655995, and 658807 from
branches/4.2.x.

2008-05-07 Martin Sebor <sebor@roguewave.com>

STDCXX-913
* include/rw/_iosfailure.h (__rw_badbit_set, __rw_eofbit_set,
__rw_failbit_set): Explicitly declared virtual dtors.
* src/exception.cpp (__rw_badbit_set, __rw_eofbit_set,
__rw_failbit_set): Defined virtual dtors out of line to
reduce code bloat and silence gcc 4.3 warning: inlining
failed, call is unlikely and code size would grow.

2008-05-20 Martin Sebor <sebor@roguewave.com>

STDCXX-941
* include/loc/_ctype.h (narrow): Silenced the useless HP aCC 3
Warning (suggestion) 887: Type 'unsigned int' is smaller than
type 'unsigned long', unwanted widening in value may result.
Regression introduced in 4.2.1 (in r649646).

2008-05-06 Travis Vitek <vitek@roguewave.com>

STDCXX-845
* src/messages.cpp (__rw_manage_cat_data): Employ a simple paging
scheme and one level of indirection to avoid moving catalog data
around when adding or removing message catalogs from the cache.
Ensure that we do cleanup when closing last catalog regardless of
the order that catalogs are closed.
* src/catalog.cpp (catclose): Fix off-by-one error exposed with
updated test.
* tests/localization/22.locale.messages.mt.cpp: Updated to test
multiple catalogs with multiple locales simultaneously.

2008-05-20 Martin Sebor <sebor@roguewave.com>

STDCXX-940
* src/ti_numpunct.cpp: Silenced the useless HP aCC 6 remark
#4244-D: extern storage class used with a function definition
while carefully avoiding HP aCC 3 Warning (suggestion) #933:
Null macro argument #1 for macro.
* src/ti_num_put.cpp: Same.
* src/ti_num_get.cpp: Same.

2008-05-22 Martin Sebor <sebor@roguewave.com>

* src/version.cpp (__rw_ident): Added a comment.

2008-05-22 Martin Sebor <sebor@roguewave.com>

* src/fpclass.h: New header with declarations of floating point
classification functions mirroring the equivalent macros defined
by C99 in <math.h>.
* src/num_put.cpp (__rw_isfinite, __rw_signbit, __rw_isinf,
__rw_isnan, __rw_isqnan, __rw_issnan): Moved inline functions to
the new fpclass.h header.

2008-05-15 Martin Sebor <sebor@roguewave.com>

STDCXX-937
* src/limits.cpp: Used the quoted form of an #include directive
to #include the <limits> header twice to fool Sun C++, otherwise
the compiler fails to #include the header twice.

2008-05-07 Martin Sebor <sebor@roguewave.com>

STDCXX-913
* include/rw/_iosfailure.h (__rw_badbit_set, __rw_eofbit_set,
__rw_failbit_set): Explicitly declared virtual dtors.
* src/exception.cpp (__rw_badbit_set, __rw_eofbit_set,
__rw_failbit_set): Defined virtual dtors out of line to
reduce code bloat and silence gcc 4.3 warning: inlining
failed, call is unlikely and code size would grow.

2008-05-04 Martin Sebor <sebor@roguewave.com>

STDCXX-908
* etc/config/src/MMAP.cpp: New test to check for mmap() and munmap()
in <sys/mman.h>.
* src/mman.cpp (__rw_mmap): Avoided using mmap() when _RWSTD_NO_MMAP
is #defined and instead dynamically allocated memory and copied the
file into it.
Defined _RWSTD_NO_MUNMAP when _RWSTD_NO_MMAP is #defined.
[_RWSTD_NO_MUNMAP](__rw_munmap): Avoided calling munmap() and instead
deallocated the block using operator delete.

2008-05-07 Travis Vitek <vitek@roguewave.com>

STDCXX-536
* tests/include/rw_thread.h (rw_thread_pool): Add timeout
parameter with default value.
(rw_thread_pool_timeout_expired): New function declaration.
* tests/src/thread.cpp: (_rw_timeout_handler): New function
to respond to alarm signals and set timeout flag.
(rw_thread_pool_timeout_expired): New function to query
timeout status.
(rw_thread_pool): Set alarm based on timeout value provided.
* tests/localization/22.locale.codecvt.mt.cpp: Add timeout
option with default value. Poll rw_thread_pool_time_expired()
in thread function and respond.
* tests/localization/22.locale.cons.mt.cpp: Ditto.
* tests/localization/22.locale.ctype.mt.cpp: Ditto.
* tests/localization/22.locale.globals.mt.cpp: Ditto.
* tests/localization/22.locale.messages.mt.cpp: Ditto.
* tests/localization/22.locale.money.get.mt.cpp: Ditto.
* tests/localization/22.locale.money.put.mt.cpp: Ditto.
* tests/localization/22.locale.moneypunct.mt.cpp: Ditto.
* tests/localization/22.locale.num.get.mt.cpp: Ditto.
* tests/localization/22.locale.num.put.mt.cpp: Ditto.
* tests/localization/22.locale.numpunct.mt.cpp: Ditto.
* tests/localization/22.locale.statics.mt.cpp: Ditto.
* tests/localization/22.locale.time.get.mt.cpp: Ditto.
* tests/localization/22.locale.time.put.mt.cpp: Ditto.

2008-05-13 Travis Vitek <vitek@roguewave.com>

STDCXX-536
* tests/localization/22.locale.codecvt.mt.cpp: Pass
opt_timeout to rw_thread_pool() to enable timeouts.
* tests/localization/22.locale.cons.mt.cpp: Ditto.
* tests/localization/22.locale.ctype.mt.cpp: Ditto.
* tests/localization/22.locale.globals.mt.cpp: Ditto.
* tests/localization/22.locale.messages.mt.cpp: Ditto.
* tests/localization/22.locale.money.get.mt.cpp: Ditto.
* tests/localization/22.locale.money.put.mt.cpp: Ditto.
* tests/localization/22.locale.moneypunct.mt.cpp: Ditto.
* tests/localization/22.locale.num.get.mt.cpp: Ditto.
* tests/localization/22.locale.num.put.mt.cpp: Ditto.
* tests/localization/22.locale.numpunct.mt.cpp: Ditto.
* tests/localization/22.locale.statics.mt.cpp: Ditto.
* tests/localization/22.locale.time.get.mt.cpp: Ditto.
* tests/localization/22.locale.time.put.mt.cpp: Ditto.

2008-05-21 Travis Vitek <vitek@roguewave.com>

* tests/localization/22.locale.moneypunct.mt.cpp: Cast timeout
to size_t to avoid conversion warnings.
* tests/localization/22.locale.numpunct.mt.cpp: Ditto.
* tests/localization/22.locale.globals.mt.cpp: Ditto.
* tests/localization/22.locale.codecvt.mt.cpp: Ditto.
* tests/localization/22.locale.cons.mt.cpp: Ditto.
* tests/localization/22.locale.money.put.mt.cpp: Ditto.
* tests/localization/22.locale.money.get.mt.cpp: Ditto.
* tests/localization/22.locale.num.put.mt.cpp: Ditto.
* tests/localization/22.locale.num.get.mt.cpp: Ditto.
* tests/localization/22.locale.statics.mt.cpp: Ditto.
* tests/localization/22.locale.time.put.mt.cpp: Ditto.
* tests/localization/22.locale.time.get.mt.cpp: Ditto.
* tests/localization/22.locale.ctype.mt.cpp: Ditto.
* tests/localization/22.locale.messages.mt.cpp: Ditto.
(thread_func): Poll thread timeout flag in thread loop.
Files Changed
MODIFY /stdcxx/branches/4.3.x/src/limits.cpp
MODIFY /stdcxx/branches/4.3.x/tests/src/thread.cpp
MODIFY /stdcxx/branches/4.3.x/tests/localization/22.locale.money.get.mt.cpp
MODIFY /stdcxx/branches/4.3.x/tests/localization/22.locale.num.put.mt.cpp
MODIFY /stdcxx/branches/4.3.x/tests/localization/22.locale.statics.mt.cpp
MODIFY /stdcxx/branches/4.3.x/tests/localization/22.locale.money.put.mt.cpp
MODIFY /stdcxx/branches/4.3.x/tests/localization/22.locale.moneypunct.mt.cpp
MODIFY /stdcxx/branches/4.3.x/src/exception.cpp
MODIFY /stdcxx/branches/4.3.x/tests/localization/22.locale.ctype.mt.cpp
MODIFY /stdcxx/branches/4.3.x/tests/localization/22.locale.time.get.mt.cpp
ADD /stdcxx/branches/4.3.x/src/fpclass.h (from /stdcxx/branches/4.2.x/src/fpclass.h)
MODIFY /stdcxx/branches/4.3.x/tests/localization/22.locale.numpunct.mt.cpp
MODIFY /stdcxx/branches/4.3.x/tests/localization/22.locale.cons.mt.cpp
ADD /stdcxx/branches/4.3.x/etc/config/src/MMAP.cpp (from /stdcxx/branches/4.2.x/etc/config/src/MMAP.cpp)
MODIFY /stdcxx/branches/4.3.x/src/ti_num_put.cpp
MODIFY /stdcxx/branches/4.3.x/src/version.cpp
MODIFY /stdcxx/branches/4.3.x/src/messages.cpp
MODIFY /stdcxx/branches/4.3.x/src/mman.cpp
MODIFY /stdcxx/branches/4.3.x/src/catalog.cpp
MODIFY /stdcxx/branches/4.3.x/tests/localization/22.locale.codecvt.mt.cpp
MODIFY /stdcxx/branches/4.3.x/include/loc/_ctype.h
MODIFY /stdcxx/branches/4.3.x/tests/localization/22.locale.time.put.mt.cpp
MODIFY /stdcxx/branches/4.3.x/tests/localization/22.locale.messages.mt.cpp
MODIFY /stdcxx/branches/4.3.x/tests/localization/22.locale.globals.mt.cpp
MODIFY /stdcxx/branches/4.3.x/src/ti_numpunct.cpp
MODIFY /stdcxx/branches/4.3.x/tests/include/rw_thread.h
MODIFY /stdcxx/branches/4.3.x/src/ti_num_get.cpp
MODIFY /stdcxx/branches/4.3.x/include/rw/_iosfailure.h
MODIFY /stdcxx/branches/4.3.x/tests/localization/22.locale.num.get.mt.cpp