diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-12-02 15:31:27 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-12-02 15:31:27 +0100 |
commit | 4c698cf891a7d946b64d95ba89d6a0d255f40712 (patch) | |
tree | 7c7f639641864f20e1f71f79f7efe3605b015db0 | |
parent | b7516041a1e540b8db3c76ef4df192404d5daafd (diff) | |
download | gcc-4c698cf891a7d946b64d95ba89d6a0d255f40712.zip gcc-4c698cf891a7d946b64d95ba89d6a0d255f40712.tar.gz gcc-4c698cf891a7d946b64d95ba89d6a0d255f40712.tar.bz2 |
re PR libgomp/43706 (scheduling two threads on one core leads to starvation)
PR libgomp/43706
* env.c (initialize_env): Default to spin count 300000
instead of 20000000 if neither OMP_WAIT_POLICY nor GOMP_SPINCOUNT
is specified.
From-SVN: r167371
-rw-r--r-- | libgomp/ChangeLog | 5 | ||||
-rw-r--r-- | libgomp/env.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 7064d66..4317202 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,5 +1,10 @@ 2010-12-02 Jakub Jelinek <jakub@redhat.com> + PR libgomp/43706 + * env.c (initialize_env): Default to spin count 300000 + instead of 20000000 if neither OMP_WAIT_POLICY nor GOMP_SPINCOUNT + is specified. + PR libgomp/45240 * parallel.c (GOMP_parallel_end): Unlock gomp_remaining_threads_lock at the end if sync builtins aren't supported. diff --git a/libgomp/env.c b/libgomp/env.c index 3eb51e8..92fa8c3 100644 --- a/libgomp/env.c +++ b/libgomp/env.c @@ -502,14 +502,14 @@ initialize_env (void) { /* Using a rough estimation of 100000 spins per msec, use 5 min blocking for OMP_WAIT_POLICY=active, - 200 msec blocking when OMP_WAIT_POLICY is not specificed + 3 msec blocking when OMP_WAIT_POLICY is not specificed and 0 when OMP_WAIT_POLICY=passive. Depending on the CPU speed, this can be e.g. 5 times longer or 5 times shorter. */ if (wait_policy > 0) gomp_spin_count_var = 30000000000LL; else if (wait_policy < 0) - gomp_spin_count_var = 20000000LL; + gomp_spin_count_var = 300000LL; } /* gomp_throttled_spin_count_var is used when there are more libgomp managed threads than available CPUs. Use very short spinning. */ |