#2156 closed defect (fixed)
psxtmthread02 test does not benchmark what it is documented as benchmarking.
Reported by: | Daniel Ramirez | Owned by: | Joel Sherrill |
---|---|---|---|
Priority: | normal | Milestone: | 4.11 |
Component: | unspecified | Version: | 4.11 |
Severity: | minor | Keywords: | |
Cc: | Blocked By: | ||
Blocking: |
Description
psxtmtests/psxtmthread02 is documented as benchmarking "pthread_create, preempt". The code reveals it is benchmarking a case of "pthread_create, no preempt" though.
psxtmthread02/init.c:
benchmark_timer_initialize();
status = pthread_create(&thread_ID, NULL, thread, NULL);
rtems_test_assert( status == 0 );
end_time = benchmark_timer_read();
The fact that a preempt does not occur is evidenced by the timer being started and stopped in the same thread. A preempt would require thead_ID to be created at a higher priority, and the timer would have to be stopped there after the call to pthread_create.
psxtmthread01 already tests the case of "pthread_create, no preempt" so I've attached a patch to fix 02 to actually test the case of "pthread_create, preempt"
Attachments (1)
Change History (4)
Changed on 11/30/13 at 17:25:02 by Daniel Ramirez
Attachment: | psxtmthread02.patch added |
---|
comment:1 Changed on 11/30/13 at 21:27:56 by Joel Sherrill
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch committed
comment:2 Changed on 11/24/14 at 18:58:28 by Gedare Bloom
Version: | HEAD → 4.11 |
---|
Replace Version=HEAD with Version=4.11 for the tickets with Milestone >= 4.11
comment:3 Changed on 10/10/17 at 06:46:55 by Sebastian Huber
Component: | testing → unspecified |
---|
patch to fix psxtmthread to actually benchmark "pthread_create, preempt"