sysconf(_SC_NPROCESSORS_ONLN) is expensive in RHEL6

Solution Verified - Updated -

Issue

  • Qt application that has a lot of threads and uses QReadWriteLocks to protect data that the threads are accessing. When the server is heavily loaded, the application spends about 60% of it's time in system time as opposed to user time. Further investigation showed that the QMutex class is calling sysconf(_SC_NPROCESSORS_ONLN) for each thread that tries to get a lock where that lock is already locked.

Environment

  • Red Hat Enterprise Linux (RHEL) 6.4
  • qt

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content