#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)

psxtmthread02.patch (2.8 KB) - added by Daniel Ramirez on 11/30/13 at 17:25:02.
patch to fix psxtmthread to actually benchmark "pthread_create, preempt"

Download all attachments as: .zip

Change History (4)

Changed on 11/30/13 at 17:25:02 by Daniel Ramirez

Attachment: psxtmthread02.patch added

patch to fix psxtmthread to actually benchmark "pthread_create, preempt"

comment:1 Changed on 11/30/13 at 21:27:56 by Joel Sherrill

Resolution: fixed
Status: newclosed

Patch committed

comment:2 Changed on 11/24/14 at 18:58:28 by Gedare Bloom

Version: HEAD4.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: testingunspecified
Note: See TracTickets for help on using tickets.