[Bug 195098] New: pthread lock performance degradation

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Nov 17 10:30:04 UTC 2014


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195098

            Bug ID: 195098
           Summary: pthread lock performance degradation
           Product: Base System
           Version: 10.0-RELEASE
          Hardware: amd64
                OS: Any
            Status: Needs Triage
          Severity: Affects Some People
          Priority: ---
         Component: threads
          Assignee: freebsd-threads at FreeBSD.org
          Reporter: ueno at gnu.org

Created attachment 149508
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=149508&action=edit
test case

It is known that Gnulib's test for its 'lock' module sometimes takes long time
to complete.  As the module is a thin wrapper around pthreads, I've rewritten
the test with pthreads functions to isolate the problem, and reproduced the
same problem.

The test basically does:

- for 50000 rounds:
  - initialize a variable PERFORMED to 0
  - create 10 threads
    - in each thread, try to increase PERFORMED by one, through pthread_once
  - check PERFORMED is 1

The symptoms I observed are:

- when the test completes in time, ~1000-3000 rounds are performed per second
- when the test takes long time, only ~10 rounds are performed per second

I'm attaching the test program, which also prints timestamp for each iteration.
 See also:
https://lists.gnu.org/archive/html/bug-gnulib/2014-09/msg00025.html
for the original bug report.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-threads mailing list