Is it possible make some KDE apps use parallelism? In particular K3B (when ripping CDs) and Gwenview (producing contact sheets)? I don't like to wait while my processor barely hits 12% (4 cores + hyperthreading).
Announcement
Collapse
No announcement yet.
Use of parallelism in KDE applications
Collapse
This topic is closed.
X
X
-
-
Linux already does this. However, prioritization of running processes is more likely to be what you are finding 'irritating'. Linux is by design, a multi-tasking OS; it doesn't wait for one process to finish before starting another.Windows no longer obstructs my view.
Using Kubuntu Linux since March 23, 2007.
"It is a capital mistake to theorize before one has data." - Sherlock Holmes
- Top
- Bottom
-
So for instance, let's take K3B. It takes 10 minutes tp re-encode a CD. It does it track by track. Only of CPU is really working. Given the amount of data read and written, it is not I/O bound. If it spawned threads or subprocesses to encode 8 tracks in parallel, the system would dispatch them to the various CPUs, all CPUs would be busy and it would take pretty close to one eighth of the time to rip the CD (OK, I could be optimistic here since hyperthreading isn't exactly a distinct CPU, but I would still expect well over a 4x improvement).
- Top
- Bottom
Comment
-
Here is a comment from a feb 2017 thread at Ask Ubuntu
A program must be made to use multiple cores. The programmer needs to write a instruction for each core.
If the program you are running don't use it, it never will without a update/upgrade.
What can I do to speed up my program?
You can disable some cores and overclock the one that is left. But first ask yourself if the program needs that speed. Or rewrite the program if possible.
Here is another one which, after some initial discussion describes using an application called "taskset" on an Ubuntu machine.
http://www.hecticgeek.com/2012/03/as...-ubuntu-linux/
again, interesting thread.
woodsmokeLast edited by woodsmoke; Jun 09, 2017, 03:42 PM.
- Top
- Bottom
Comment
-
One can use Ksysguard to change the niceness (priority) of an application. Right mouse in the app."A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
– John F. Kennedy, February 26, 1962.
- Top
- Bottom
Comment
-
Originally posted by woodsmoke View PostHere is a comment from a feb 2017 thread at Ask Ubuntu
A program must be made to use multiple cores.
taskset doesn't make a process run on several cores in parallel. It only ensure that a given process will be dispatched on specific cores.
If the application is written to use only one flow of execution (and therefore run on a single CPU core at a time), which is what happens by default, nothing is going to make it run on several cores. Increasing its priority is only useful when it competes against other processes for CPU.
- Top
- Bottom
Comment
-
One thing I haven't heard mentioned is that the default CPU governor in almost all Linux kernels is the ondemand governor, which will not scale up processor frequency until CPU utilization hits 95%. Machines using the intel_pstate driver (third-generation Intel Core and later) default to the powersave governor.
Since IMO processor frequency has almost zero impact on power consumption both my laptop and home server are locked at highest frequency by using the performance governor instead of the ondemand (or in the case of my laptop, powersave) governor.
Excellent read here - https://wiki.archlinux.org/index.php...quency_scaling
You can't make a single-threaded application use more threads but you can increase CPU frequency, which will make all those threads run a little quicker.we see things not as they are, but as we are.
-- anais nin
- Top
- Bottom
Comment
-
Originally posted by Ofnuts View PostExactly. And my question is, are K3B and Gwenview written for this? Many application may support this with some obscure and barely documented setting (for instance, Gimp will check GEGL_THREADS in the environment).
KDE and most of its apps are written using the Qt API. The documentation discusses threading here: http://doc.qt.io/qt-5/thread-basics.html
Qt has "Signals and Slots" technology to simplify call-backs and communication between threads and between a thread and its parent. S&S simplifies a lot of things but there are still a lot of things that can go awry and threading apps are very difficult to debug.
Originally posted by Ofnuts View Posttaskset doesn't make a process run on several cores in parallel. It only ensure that a given process will be dispatched on specific cores.
Originally posted by Ofnuts View PostIf the application is written to use only one flow of execution (and therefore run on a single CPU core at a time), which is what happens by default, nothing is going to make it run on several cores. Increasing its priority is only useful when it competes against other processes for CPU.Last edited by GreyGeek; Jun 10, 2017, 10:04 AM."A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
– John F. Kennedy, February 26, 1962.
- Top
- Bottom
Comment
-
Originally posted by GreyGeek View PostK3B is written using threads but the developer said it was difficult to do because he needed the threads to talk to each other. I don't know about Gwenview, although I doubt it. Not very many apps are designed to use threading or multiple processes. That's partly because most applications cannot be broken down into parallel processes that can be threaded simultaneously while allowing the app to continue accepting input from the user for processing. [...] Certain classes of problems are a fit for threading and multiple processes but most are not.
Originally posted by GreyGeek View PostPrograms suitable for multiple threads or processes are usually run on super computers with thousands of cores, or more
Originally posted by GreyGeek View PostOriginally posted by OfnutsTrue, but running on more than one core may give better results than running on only one, but it depends on how the app was designed.
- Top
- Bottom
Comment
-
soundkonverter is a multithreaded audio conversion application built for KDE that can also apparently rip CDs (didn't know it could do CD ripping or I'd have mentioned it earlier).
I use it to convert flac to mp3 since my car doesn't do flac - and I've had it running as many as eight threads at a time.Last edited by wizard10000; Jun 12, 2017, 11:12 AM.we see things not as they are, but as we are.
-- anais nin
- Top
- Bottom
Comment
Comment