https://bugs.documentfoundation.org/show_bug.cgi?id=98955

            Bug ID: 98955
           Summary: hardware_concurrency not ideal for thread pools ...
           Product: LibreOffice
           Version: 5.1.0.1 rc
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: LibreOffice
          Assignee: [email protected]
          Reporter: [email protected]

Currently we use:

std::thread::hardware_concurrency()

in several places to see what parallelism we can use to optimize performance.

This leads to some amusing situations; eg. in Largo Florida they have terminal
server machines with ~80 CPUs - and so things like XLSX loading, and/or image
scaling end up creating huge scads of threads that look like:

Thread 65 (Thread 0x7f3d858b6700 (LWP 56434)):
#0  0x00007f3daa0f238c in pthread_cond_wait@@GLIBC_2.3.2 () from
/lib64/libpthread.so.0
#1  0x00007f3dab311c4b in osl_waitCondition () from
/opt/libreofficedev5.0/program/libuno_sal.so.3
#2  0x00007f3da63d5739 in comphelper::ThreadPool::ThreadWorker::execute() ()
from /opt/libreofficedev5.0/program/libcomphelper.so
#3  0x00007f3da5542516 in salhelper::Thread::run() () from
/opt/libreofficedev5.0/program/libuno_salhelpergcc3.so.3
#4  0x00007f3da554271a in threadFunc () from
/opt/libreofficedev5.0/program/libuno_salhelpergcc3.so.3
#5  0x00007f3dab3206e7 in osl_thread_start_Impl(void*) () from
/opt/libreofficedev5.0/program/libuno_sal.so.3
#6  0x00007f3daa0eda3f in start_thread () from /lib64/libpthread.so.0
#7  0x00007f3dab04871d in clone () from /lib64/libc.so.6
#8  0x0000000000000000 in ?? ()

Thread 64 (Thread 0x7f3d8dff5700 (LWP 56435)):
#0  0x00007f3daa0f238c in pthread_cond_wait@@GLIBC_2.3.2 () from
/lib64/libpthread.so.0
#1  0x00007f3dab311c4b in osl_waitCondition () from
/opt/libreofficedev5.0/program/libuno_sal.so.3
#2  0x00007f3da63d5739 in comphelper::ThreadPool::ThreadWorker::execute() ()
from /opt/libreofficedev5.0/program/libcomphelper.so
#3  0x00007f3da5542516 in salhelper::Thread::run() () from
/opt/libreofficedev5.0/program/libuno_salhelpergcc3.so.3
#4  0x00007f3da554271a in threadFunc () from
/opt/libreofficedev5.0/program/libuno_salhelpergcc3.so.3
#5  0x00007f3dab3206e7 in osl_thread_start_Impl(void*) () from
/opt/libreofficedev5.0/program/libuno_sal.so.3
#6  0x00007f3daa0eda3f in start_thread () from /lib64/libpthread.so.0
#7  0x00007f3dab04871d in clone () from /lib64/libc.so.6
#8  0x0000000000000000 in ?? ()
...

Which is less than ideal.

Most likely we should have a tweak-able, to affect the maximum parallelism we
want to exploit as a single user on the machine.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to