The tag has no usage guidance.

learn more… | top users | synonyms

21
votes
5answers
2k views

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 ...
16
votes
6answers
19k views

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 ...
7
votes
1answer
11k views

Multi-Threading/Forking in a bash script

I have written a bash script which is in following format: #!/bin/bash start=$(date +%s) inFile="input.txt" outFile="output.csv" rm -f $inFile $outFile while read line do -- Block of Commands ...
7
votes
3answers
5k views

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 ...
6
votes
3answers
7k views

Multithreaded cp on linux? [duplicate]

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.
6
votes
3answers
16k views

How to call a service URL from bash shell script in parallel?

I have a service which I am calling from another application. Below is my service URL which I am calling - http://www.betaservice.domain.host.com/web/hasChanged?ver=0 I need to do some load test ...
6
votes
2answers
16k views

Linux max threads count

my server has been running with Amazon Ec2 linux. I have a mongodb server inside. The mongodb server has been running under heavily load, and, unhappily , I've ran into a problem with it :/ As known, ...
6
votes
2answers
2k views

What is the need of the struct thread_info in locating struct task_struct?

While reading through the Linux Device Drivers, I could understand that the Process Descriptor (of type struct task_struct) has all the info regarding a particular task. The process descriptors are ...
5
votes
2answers
19k views

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); ...
4
votes
3answers
108 views

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 ...
3
votes
3answers
2k views

Is crontab multithread?

I don't know where I can find more information about crontab, so I ask here. Crontab is it multithread? How does it work?
3
votes
3answers
16k views

How to launch two threads in bash shell script?

I am trying to copy files from machineB and machineC into machineA as I am running my below shell script on machineA. If the files is not there in machineB then it should be there in machineC for ...
3
votes
1answer
463 views

What makes the Linux scheduler seem unpredictable?

The question refers to the output of a multi-threaded application, where each thread merely prints its ID (user assigned number) on the standard output. Here all threads have equal priority and ...
3
votes
1answer
632 views

Is vim multithreaded?

I have a HUGE (and I mean huge) text file that I am going to process with vim. I could process it using two different (debian) machines. One is duel-core and one is octo-core. A single core on my ...
3
votes
2answers
2k views

Speed up zgrep on a multi-core computer

I'm running zgrep on a computer with 16 CPUs, but it only takes one CPU to run the task. Can I speed it up, perhaps utilize all 16 cores? P.S The IO is just fine, I could just copy the gzipped file ...
3
votes
2answers
1k views

What is meant by stack in connection to a process?

From the book Advanced programming in the Unix environment I read the following line regarding threads in Unix like systems All the threads within a process share the same address space, file ...
3
votes
1answer
30 views

How do I specify which core a pthread is spawned on

I am running a cluster where each node has an Intel Xeon E5430. /proc/cpuinfo reports 8 cores. I am using C/C++ compiled with gcc ver 5.3.1 on an Ubuntu 16.04LTS. Distributing my work to each node ...
3
votes
1answer
92 views

Is each process considered a thread?

Is a Linux process considered a thread? For example, if I write a simple c program that calls pthread_create to create a new thread in main(), does that mean that I now have 2 threads, one for main()...
3
votes
1answer
1k views

Does uClibc support using pthreads?

I recently attended an embedded Linux course that stated that uClibc does not support the use of pthreads and that it only supports linuxthreads. Furthermore, the course instructor implied that ...
2
votes
3answers
484 views

Is any part of the X.org software multithreaded?

None of the command-line shells that I am aware of are multithreaded. In particular, even those shells that support "job control" (Control-Z, bg, fg, etc) do so via facilities (namely, fork, exec, ...
2
votes
3answers
145 views

Linux - preventing an application from failing due to lack of disk space

Due to an unpredicted scenario I am currently in need of finding a solution to the fact that an application (which I do not wish to kill) is slowly hogging the entire disk space. To give more context ...
2
votes
1answer
1k views

Which system calls could create a new process?

When executing ps command in my Linux system i see some user processes twice (different PID...). I wonder if they are new processes or threads of the same process. I know some functions in standard C ...
2
votes
2answers
46 views

How to run bash script via multithreading

I have bash script which creates high energy collision events, if one event takes around 2 minutes then for 100000 events it takes 200000 minutes, which is too much. so if I have 50 cores in a node, I ...
2
votes
1answer
14 views

Pthread scheduler scope variables?

I read that their is 1:1 mapping of user and kernel thread in linux What is the difference between PTHREAD_SCOPE_PROCESS & PTHREAD_SCOPE_SYSTEM in linux if kernel is considering every thread ...
2
votes
1answer
68 views

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 ...
2
votes
1answer
1k views

Running a process multiple times at the same time

I have a c++ program with opencv library which takes an image as input and perform pose estimation,color detection,phog. When I run this program from the command line it takes around 4-5sec to ...
2
votes
1answer
109 views

Multi processing / Multi threading in BASH

I have a test file that looks like this 5002 2014-11-24 12:59:37.112 2014-11-24 12:59:37.112 0.000 UDP ...... 23.234.22.106 48104 101 0 0 8.8.8.8 53 68.0 1.0 1 0.0 0 68 0 48 Each line contains a ...
2
votes
2answers
90 views

how to workaround a deadlock (multithreading a program)

I need to run a program 100 times, a few hours each, which is fine when running it in a serial way, just takes very long, but when I try to parallelize it using GNU parallel or simple '&' in bash, ...
2
votes
0answers
60 views

Is using threads still considered an anti-pattern? [closed]

Background In The Art of Unix Programming, Eric S. Raymond dismisses multithreaded programming as a performance hack that should be avoided. According to him, the biggest problem with threads is that ...
2
votes
0answers
372 views

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? On my opinion, the signal API should be ...
2
votes
1answer
140 views

Multiplex bash function execution

I created a bash function to "automagically" connect on our switches and retrive their startup-config using the expect command. I have to use expect because this switch does not accept the ssh user@...
2
votes
0answers
127 views

multithread handling in AM1808 using embedded Linux

I am using AM1808 ARM9 based board using GCC compiler (UBUNTU 10.04) . I am using Sqlite3 database management. I have some requirement regarding handling threads in background having access on ...
2
votes
0answers
229 views

So the design of client-server separation is not the bottleneck of X Window?

In the answer of this, it mentioned: People also hear that X uses the "network" and think this is going to be a performance bottleneck. "Network" here means local UNIX domain socket, which has ...
1
vote
3answers
500 views

can the “cat” command use multi-processes

I need to merge bunch of files in a directory on a unix box that has 8 cores. I am looking for a fast way to merge these files. The cat command uses only one core... is there a way where I can make it ...
1
vote
1answer
100 views

Threads vs interrupts

What does it mean when threads are time-sliced? Does that mean they work as interrupts, don't exit while routine is not finished? Or it executes one instruction from one thread then one instruction ...
1
vote
1answer
1k views

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 ...
1
vote
1answer
242 views

How to copy in two folders simultaneously using GNU parallel by spawning multiple threads?

I am trying to copy files from machineB and machineC into machineA as I am running my below shell script on machineA. If the files is not there in machineB then it should be there in machineC for ...
1
vote
2answers
4k views

System sending SIGTERM and SIGKILL during normal work

I have a program (C++) that works with TCP sockets in multithreaded manner. The multithreading is intensive, about 100 threads (POSIX threads). Sometimes, not quite sure when, the program gets ...
1
vote
2answers
114 views

Can a single core of a cpu process more than one process?

This is the reasoning for my question is what I read in a text book which states: Each CPU (or core) can be working on one process at a time. I'm assuming that this used to be accurate but is no ...
1
vote
1answer
720 views

Analyzing the behavior of a threaded program

Is there an application that will do what Threadscope or the parallel tools of Visual Studio does for multithreaded program analysis in Linux?
1
vote
2answers
65 views

Need to format 5 disks in parallel

I tried this xargs -p 5 -n1 mke2fs -t ext4 /dev/sd[d-p]1 and got this [/dev/mapper]# seq 1 15 | xargs -p 5 -n 1 mke2fs -t ext4 /dev/sd[b-p]1 5 -n 1 mke2fs -t ext4 /dev/sdb1 /dev/sdc1 /dev/sdd1 /...
1
vote
1answer
1k views

Running a python script 200,000 times in parallel using bash [duplicate]

I need to run my Python script 200,000 times. Is it possible to do parallel execution using bash? Since it's 200,000 times I would like to use at least 10 threads simultaneously
1
vote
2answers
543 views

How to copy three files at once instead of one file at a time in bash shell scripting?

I am running my shell script on machineA which copies the files from machineB and machineC to machineA. If the file is not there in machineB, then it should be there in machineC for sure. So I will ...
1
vote
2answers
528 views

Make Ubuntu acknowledge that a custom built version of PHP is installed

I'm trying to install PHP from source code on my Ubuntu 12.04 VPS. I'm installing PHP like this: Download the latest version from the php.net website. Configure it using the parameters below. ...
1
vote
0answers
48 views

What are scheduler Activations?

I am reading about multi-threading in Peter Baer Galvin's Operating System Concepts; I don't understand the following topics: How LWP (virtual processor) works and schedules threads or maps to ...
1
vote
1answer
235 views

Set ionice for a multi-threaded application

I have a program that spawns multiple threads, all of which do fairly intensive IO, running on the background. I want to set the scheduling class to idle so that it doesn't clog up the system; however,...
1
vote
1answer
319 views

Limit max thread use for multithreaded java app

I have downloaded a .jar file and am using java with it, and it seems multithreaded, which is great ... unless I don't want it to be multithreaded, or unless I want to use only N threads with it. Is ...
1
vote
0answers
2k views

What exactly is the lwp and threads in solaris?

The book "Solaris Internals" says Solaris executes kernel threads for kernel-related tasks, such as interrupt handling, memory page management, device drivers, etc. For user-process execution, kernel ...
0
votes
1answer
36 views

Multithreading (increasing the number of threads for the process)

I wonder if there is any way of adding thread to specific process just to prove that number of thread which are assigned to process can be changed by user. If so, how could I do that ? [root@195689 ...
0
votes
2answers
49 views

Plain installation vs Virtual machines - what is better for multicore? [closed]

We've currently bought a new server, with 64 GB of RAM and 8 cores with hyperthreading support. We are going to build a system using: nginx. apache. mysql. php So, the question is about ...