From: Cyril H. <ch...@su...> - 2011-12-21 13:12:32
|
Hi! > testcase create NCPU=4 threads running with a high priority with the same sched > policy and one with a low-priority. The low-priority thread should not run > until the other threads stop running, unless the machine has more than NCPU processors > when cpu core >4,testcase failed. redefine NCPU = sysconf(_SC_NPROCESSORS_CONF) There are two problems with that. The first one, and less problematic, is that _SC_NPROCESSORS_CONF is not yet POSIX standardized. The second and more problematic part is that such process would eat all your CPU time, which may easily lock the whole box while testing. I think that best solution for this is to use affinity (which is not standartized by POSIX either, but at least the code is isolated in one header in open_posix_testsuite/include/) to lock two test threads on one CPU. See conformance/interfaces/sched_yield/1-1.c and include/affinity.h in open_posix_testsuite as an example. And if you choose to rewrite the test, please remove the usage of testfrmw. -- Cyril Hrubis ch...@su... |