3 ms·
As a Python guy, it's an API layer on top of POSIX threads organizing calls to a shared library extension written in C. Most of the time is spent in the C exten
by dalke 15y ago
As a Python guy, it's an API layer on top of POSIX threads organizing calls to a shared library extension written in C. Most of the time is spent in the C extension (max 10 seconds out of 130), so doesn't seem right to call it the "Python" version.
In any case, the section is "using pthreads from Python" and the chart lists "Python/pthreads", so I think I labeled it well enough, and won't be making a change.
(The point, after all, was to compare an OpenMP version to something which doesn't use OpenMP.)
- scott_s 15y agoPython is driving the program, and the threading library you're using provides its own abstractions on top of Pthreads itself. Pthreads has no concept of work pools - although many people end up implementing them when using Pthreads. Pthreads is a relatively low-level library that specifies how to create and join threads, and then provides mutexes and condition variables to synchronize across them. The threading library you're using hides all of that from you (which is a good thing!). Where the code spends most of its time isn't the important thing for classification. What's important is what decided the structure of your code? And that was the threading library as provided by Python, not Pthreads. In fact, the threading library you're using only incidentally uses Pthreads as their implementation mechanism, similar to how gcc's implementation of OpenMP only incidentally uses Pthreads.