http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55411



             Bug #: 55411

           Summary: OMP threads lose their OMP_WAIT_POLICY when another

                    OMP thread gets destructed

    Classification: Unclassified

           Product: gcc

           Version: 4.6.3

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: libgomp

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: jk3...@arcor.de





So there are 2 bugs:

 * the omp workers of a boost::thread are ignoring OMP_WAIT_POLICY

 * once the boost::thread gets destructed the main-thread's omp worker's

WAIT_POLICY get lost



used to compile the example:

g++ -fopenmp -lgomp -lboost_system -lboost_thread-mt -o foo.bin -O2 foo_omp.c



tested with gentoo:

Just run the example with `export OMP_WAIT_POLICY="ACTIVE"` and watch it in

another window with htop. First all created omp threads use 100%, then the

boost::thread and its omp workers are spawned (all with ~0% cpu usage, still

the main-thread's omp workers use 100%). Then the boost::thread gets destructed

and the main-threads omp workers fallback to 0% cpu usage.



PS: It would be nice if there was a GOMP_DEBUG to enable a more verbose output,

esp. to debug GOMP_SPINCOUNT & OMP_PROC_BIND.

Reply via email to