Wrong number of threads created / thread congestion

Issue #30 resolved
Jakob Nissen created an issue

I’m not sure this is actually a problem, but I noted that during a KMA-heavy workflow, my MacOS “Activity monitor” program reported, among other processes, this:

The columns are: “Name, CPU % usage, CPU seconds, threads, idle/wakeup”.

I had allocated 2 threads for these KMA jobs, yet it has spawned 5 threads. Also, it had 8000 thread idle/wakeups in 16 seconds. Could this be an indication of thread congestion in KMA, where too many threads are spawned for too little work?

Comments (2)

  1. ptlcc

    KMA is split into a reader, a worker (one or two depending on options), and a collector (depending on options). Where the working processes are multi-threaded, this was performed to better unzip the input data as that often is the bottleneck (and can’t be multithreaded).
    KMA will not check if the allocated threads are actually needed when added to the worker parts, where they will mostly sleep if not needed. But in very short intervals, leading to the large number of wake-ups when they aren’t really needed.

    Best,
    Philip

  2. Log in to comment