Questions tagged [multithreading]

153 questions
44
votes
8 answers

Get chrome's total memory usage

Since google chrome/chromium spawn multiple processes it's harder to see how much total memory these processes use in total. Is there an easy way to see how much total memory a series of connected processes is using?
Ryan1729
  • 591
  • 1
  • 4
  • 7
38
votes
7 answers

Why using more threads makes it slower than using less threads

Tried to run program X using 8 threads and it was over in n minutes. Tried to run same program using 50 threads and it was over in n*10 minutes. Why does this happen and how can I get optimal number of threads I can use?
pogibas
  • 651
  • 1
  • 8
  • 12
38
votes
2 answers

What happens to a multithreaded Linux process if it gets a signal?

If a Unix (Posix) process receives a signal, a signal handler will run. What will happen to it in a multithreaded process? Which thread receives the signal? In my opinion, the signal API should be extended to handle that (i.e. the thread of the…
peterh
  • 9,488
  • 16
  • 59
  • 88
36
votes
2 answers

Default stack size for pthreads

As I understand, the default stack size for a pthread on Linux is 16K. I am getting strange results on my 64-bit Ubuntu install. $ ulimit -s 8192 Also: pthread_attr_init(&attr); pthread_attr_getstacksize(&attr, &stacksize); printf("Thread stack…
Kamath
  • 595
  • 2
  • 6
  • 7
34
votes
2 answers

Understanding output of lscpu

You can see the output from lscpu command - jack@042:~$ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 56 On-line CPU(s) list: 0-55 Thread(s) per core: …
cph_sto
  • 443
  • 1
  • 4
  • 7
27
votes
4 answers

How can I kill a particular thread of a process?

$ ps -e -T | grep myp | grep -v grep 797 797 ? 00:00:00 myp 797 798 ? 00:00:00 myp 797 799 ? 00:00:00 myp 797 800 ? 00:00:00 myp This shows the process myp with PID = 797 and four threads with different…
Lazer
  • 34,477
  • 25
  • 70
  • 75
25
votes
3 answers

How to use multi-threading for creating and extracting tar.xz

I use tar -cJvf resultfile.tar.xz files_to_compress to create tar.xz and tar -xzvf resultfile.tar.xz to extract the archive in current directory. How to use multi threading in both cases? I don't want to install any utilities.
ewr3243
  • 357
  • 1
  • 3
  • 7
25
votes
1 answer

How to use "parallel" to speed up "sort" for big files fitting in RAM?

I have a 100 M line file that fits in RAM on a GNU/Linux system. This is rather slow: sort bigfile > bigfile.sorted and does not use all 48 cores on my machine. How do I sort that file fast?
Ole Tange
  • 33,591
  • 31
  • 102
  • 198
21
votes
5 answers

How to run a command at an average of 5 times per second?

I have a command-line script that performs an API call and updates a database with the results. I have a limit of 5 API calls per second with the API provider. The script takes more than 0.2 seconds to execute. If I run the command sequentially, it…
BenMorel
  • 4,447
  • 8
  • 36
  • 46
21
votes
3 answers

Multithreaded cp on linux?

Is there a multi-threaded cp command on Linux? I know how to do this on Windows, but I don't know how this is approached in a Linux environment.
leeand00
  • 4,443
  • 10
  • 51
  • 78
18
votes
4 answers

Are basic POSIX utilities parallelized?

In a common Linux distribution, do utilities like rm, mv, ls, grep, wc, etc. run in parallel on their arguments? In other words, if I grep a huge file on a 32-threaded CPU, will it go faster than on dual-core CPU?
homocomputeris
  • 391
  • 2
  • 13
14
votes
2 answers

Why on modern Linux, the default stack size is so huge - 8MB (even 10 on some distributions)

For example, on OSX, it's even less than 512k. Is there any recommended size, having in mind, that the app does not use recursion and does not allocate a lot of stack variables? I know the question is too broad and it highly depends on the usage,…
Kiril Kirov
  • 287
  • 1
  • 3
  • 10
12
votes
1 answer

Use multi-threaded make by default?

Is there any way to have make use multi-threading (6 threads is ideal on my system) system-wide, instead of by just adding -j6 to the command line? So, that if I run make, it acts the same as if I was running make -j6? I want this functionality…
markasoftware
  • 706
  • 2
  • 8
  • 19
12
votes
3 answers

Why do top and ps show different PIDs for the same processes?

When I run top -H, I see that my multiple mysql threads all have the same PID. However, in ps -eLf I see each one has a different PID: ps -eLf UID PID PPID LWP C NLWP STIME TTY TIME CMD mysql 1424 1 1424 0 17 18:41 ? …
Madan Ram
  • 545
  • 2
  • 5
  • 7
10
votes
1 answer

unpigz (and untar) to a specific directory

I know how to gunzip a file to a selected location. But when it comes to utilizing all CPU power, many consider pigz instead of gzip. So, the question is how do I unpigz (and untar) a *.tar.gz file to a specific directory?
Neurotransmitter
  • 2,883
  • 2
  • 19
  • 30
1
2 3
10 11