From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 637 invoked by alias); 20 Apr 2010 10:49:49 -0000 Received: (qmail 535 invoked by uid 48); 20 Apr 2010 10:49:35 -0000 Date: Tue, 20 Apr 2010 10:49:00 -0000 Message-ID: <20100420104935.534.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libgomp/43706] scheduling two threads on one core leads to starvation In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jakub at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-04/txt/msg02003.txt.bz2 ------- Comment #6 from jakub at gcc dot gnu dot org 2010-04-20 10:49 ------- Created an attachment (id=20441) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20441&action=view) gcc46-pr43706.patch For GOMP_CPU_AFFINITY there was an issue that the number of available CPUs used to decide whether the number of managed threads is bigger than available CPUs didn't take into account GOMP_CPU_AFFINITY restriction. The attached patch does that. That said, for cases where some CPU is available for the GOMP program, yet is constantly busy doing other things (say higher priority), this can't help and OMP_WAIT_POLICY=passive or GOMP_SPINCOUNT=1000 or some similar small number is your only option. -- jakub at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at gcc dot gnu |jakub at gcc dot gnu dot org |dot org | Status|UNCONFIRMED |ASSIGNED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43706