From: <sv...@va...> - 2007-11-18 01:16:50
|
Author: sewardj Date: 2007-11-18 01:16:52 +0000 (Sun, 18 Nov 2007) New Revision: 7179 Log: Try to fix, or at least avoid if possible, some arbitrary delays at thread creation time observed when running on POWER5 64-bit Linux. Modified: trunk/helgrind/hg_intercepts.c Modified: trunk/helgrind/hg_intercepts.c =================================================================== --- trunk/helgrind/hg_intercepts.c 2007-11-17 23:00:47 UTC (rev 7178) +++ trunk/helgrind/hg_intercepts.c 2007-11-18 01:16:52 UTC (rev 7179) @@ -216,8 +216,13 @@ /* we have to wait for the child to notify the tool of its pthread_t before continuing */ while (xargs[2] != 0) { - // FIXME: add a yield client request - /* do nothing */ + /* Do nothing. We need to spin until the child writes to + xargs[2]. However, that can lead to starvation in the + child and very long delays (eg, tc19_shadowmem on + ppc64-linux Fedora Core 6). So yield the cpu if we can, + to let the child run at the earliest available + opportunity. */ + sched_yield(); } } else { DO_PthAPIerror( "pthread_create", ret ); |