parallel-runtimes / lomp

Little OpenMP Library
Apache License 2.0
153 stars 17 forks source link

Barriers are not handling tasks correctly #47

Open JimCownie opened 2 years ago

JimCownie commented 2 years ago

Describe the bug The current implementation of barriers (all of them!) assumes that once a thread has entered a barrier only the barrier code needs to execute. That is incorrect, since other threads (which have not yet entered the barrier) may create tasks that a thread inside the barrier could execute.

The barrier polling code needs to be calling out to the tasking code to allow tasks to be executed even though a thread has checked in to the barrier.

To Reproduce Read the code.

Expected behavior Threads which have checked into a barrier should still be looking for tasks to execute.

Desktop (please complete the following information):