Questions tagged [pid]

Use this tag for questions about Process ID. For questions about PID-controllers, use [pid-controller] instead.

In computing, the process identifier (normally referred to as the process ID or just PID) is a number used by most operating system kernels (such as that of UNIX, Mac OS X or Microsoft Windows) to (temporarily) uniquely identify a process. This number may be used as a parameter in various function calls allowing processes to be manipulated, such as adjusting the process's priority or killing it altogether.

If your question is about Proportional Integral Derivative control, please use instead.

1697 questions
0
votes
3 answers

Put single pid CPU into a variable on Linux

I need to put the CPU value of a particular pid into a variable to detect its value. I am able to get the pid of the program by using pidof and I am able to get the CPU value by using: ps -p -o %cpu which gives me: %CPU 14.8 But I do no want…
omega1
  • 1,031
  • 4
  • 21
  • 41
0
votes
1 answer

multi-threading in bash script and echo pids from loop

I want to run a command with different arguments in multi-threading form, What I tried is: #!/bin/bash ARG1=$1 ARG2=$2 ARG3=$3 for ... #counter is i do main command with ARG1 ARG2 ARG3 & a[i]=$! done wait `echo ${a[@]}` I used & a[i]=$! in…
MLSC
  • 5,872
  • 8
  • 55
  • 89
0
votes
1 answer

Print percent memory and CPU for all processes cumulative on linux

Does printing %MEM and %CPU for Process ID 1 give the %CPU and %MEM for all processes across all users on that linux box? If not, what is the best alternative? I assume that it's possible to sum the %MEM and %CPU across all the processes generated…
Louie Mazin
  • 83
  • 2
  • 9
0
votes
0 answers

C how do I know when the child process in background ends?

I'm trying to make my own shell in unix. I want to make child process run in background with adding PID to jobList. And when it ends, I want it to delete PID from jobList. But I don't understand how should I know when the child process in background…
Pandol
  • 39
  • 1
  • 1
  • 4
0
votes
1 answer

Handle GUI window changes

I'm doing an automation script for installation wizards using AutoIt. I'm trying to handle window changes in some way. Can some one explain how these GUI's work? When I click on the Next button it looks just like the components in the GUI is beeing…
MrYdremark
  • 11
  • 2
0
votes
0 answers

Loading pid_t into an array for use OUTSIDE of forked process C/linux

I have have an application that forks quite a few child processes. I would like to store these child pid's in an array so when MAX_CHILD is reached. I can kill off the oldest ones. Any way of accomplishing this ? note... In my real application I…
user2815333
  • 486
  • 1
  • 3
  • 9
0
votes
1 answer

Detect end of process from a sub-shell in ksh

I launch a master script : master.ksh I want to do some background task during the work of master.ksh. For this, I created an script sourced at the beggining of master.ksh : slave.ksh with a $ ./slave.ksh & here is the code of slave.ksh:…
heyhey
  • 191
  • 2
  • 12
0
votes
1 answer

Determine which threaded process running in the background finished last on AIX

If I have a parent process which forks to 5 child processes in the background and a wait, ie. job1.sh& job2.sh& job3.sh& job4.sh& job5.sh& wait Would it be possible to find out which of the jobs I have ran finished last? I want this to be fully…
Louie Mazin
  • 83
  • 2
  • 9
0
votes
1 answer

How to switch to another running application using its process id in C++?

How can I switch to another running application in Windows 7 and C++ when I know its process id? I only have the process id. There might be several applications with the same name so using the window title does not work. I also do not have a…
HardCoder
  • 3,026
  • 6
  • 32
  • 52
0
votes
1 answer

Using shared memory between two programs

I'm having some issues with shared memory. I want to pass a value into shared memory from program a that will be messed with and put back into that shared memory from program b, that program one can then read. As of now I can only get it to show me…
Joe
  • 17
  • 1
  • 6
0
votes
1 answer

why pid of child and its process are different?

Here my code: extern int errno; pid_t system1(const char * command) { pid_t pid; pid = fork(); cout<<"PID in child "<<(int)pid<
EmptyData
  • 2,386
  • 2
  • 26
  • 42
0
votes
0 answers

A way to get just directories and PIDs using wmic?

I'm trying to write a script that handles application deployment, based off new builds. Unfortunately, our software (java/weblogic) doesn't have a very reliable "shutdown" command, so we're more or less forced to just kill the running processes…
MrDuk
  • 16,578
  • 18
  • 74
  • 133
0
votes
1 answer

How can i get a pid of a process generated by cmd line?

I want to know how to get a pid of a process started by cmd instruction. Here's an example string instruction = "mpiexec FDTD.exe"; System.Diagnostics.ProcessStartInfo proInfo = new System.Diagnostics.ProcessStartInfo(); System.Diagnostics.Process…
0
votes
3 answers

Why isn't this if statement working?

I'm forking, and executing a certain block in the child process. My problem is that my child process never gets into the if statement. Why is this? if((x = strcmp(subargs[next_redirect], ">")) == 0) { pid = fork(); …
Chris Phillips
  • 1,997
  • 2
  • 19
  • 34
0
votes
1 answer

determine last background pid from within c++ app

I have an embedded linux project I am building in C++. The arch is arm and the processor is a freescale imx6. I am running multiple audio files in the background using: sprintf(sysdev,"gst-launch playbin2 uri=file://%s audio-sink=""alsasink…
1 2 3
99
100