Skip to main content

Questions tagged [pid]

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

pid
0 votes
1 answer
24 views

If the Linux kernel reassigns a PID, can this cause errors/UB when using C pthread mutexes?

If I'm getting it right, is it possible in the Linux pthread C API to use robust mutexes, that can be shared across processes (by placing them in shared memory), and that allows you to acquire the ...
Alessandro Bertulli's user avatar
0 votes
1 answer
29 views

how to change the terminal prompt (bash) in vs code mac

so my terminal prompt in vs code mac is showing the process ID and then $. my current shell is bash. but i want my prompt to say the literal name of the directory that i am in and then a $ sign. if ...
Ahmad zaeem Zahid's user avatar
-2 votes
3 answers
138 views

if(fork()) and if(!fork()) - how do they work?

Let's say we have the following: pid_t pid; pid = fork(); if(pid == 0) { if(fork()) printf("A"); else printf("B"); printf("C"); } else { ...
RhoThanos's user avatar
0 votes
0 answers
17 views

How to avoid races with process IDs when reading /proc

As I understand it, on Linux process IDs are reused, and also the only API for a lot of process-related stuff (e.g. finding child processes of a specific process) is /proc/<pid>/.... But don't ...
Timmmm's user avatar
  • 93.6k
0 votes
1 answer
31 views

How do I determine thread index in its thread group from inside of the kernel?

I need, for a given thread group, to get each of its member threads sequential index to store some data about each thread from inside of the kernel, I have access to task_struct. Something like "...
blonded04's user avatar
  • 463
2 votes
0 answers
47 views

Force parent process to be set to init(1) when process is orphaned

I have a process (X) that is spawned by another process (Y). Prior to the spawn, Y set itself as a subreaper (using prctrl PR_SET_CHILD_SUBREAPER). Is there any way a fork from X can skip Y and have ...
Baruch's user avatar
  • 21.2k
2 votes
1 answer
51 views

How to get the PID of a process launched from another process with the execlp c function?

I am working with a Debian (Linux like) OS writing code in c. I am a running process (let's call it "A") which needs to launch an executable program AND to get its PID when the new process &...
Guille's user avatar
  • 430
1 vote
0 answers
48 views

from where the child process will get informations about other variables that are before the fork()?

in my case i have a code where there are mentioned many fork() (8 times) functions so many child processes are going to be created , so let's imagine the every fork() is related to its variable like ...
Mounir Elkatmour's user avatar
0 votes
0 answers
34 views

Robotics PD controller

I'd like to share my code. I'm having trouble understanding why my robot doesn't reach the desired positions when I increase the value of Kp. The robot has six degrees of freedom, and I'm using a PD ...
user24879787's user avatar
0 votes
0 answers
19 views

Persistent PID Issue with npm run dev Causing 'Connection Reset' Error

Hi I'm encountering a recurring issue with my project setup vite 5173 dev mode. Every time I run npm run dev, I face the following error in my browser: The connection was reset The connection to the ...
dadashussein's user avatar
0 votes
0 answers
23 views

the process made twice, when i execute my program once

In Linux, I have just simple test code to testing process made once or twice. when I execute my program program is just sleep 2seconds and print something inside for loop sudo ./test & the ...
Kundera's user avatar
  • 155
3 votes
0 answers
92 views

Is there a correct way to do PID/TID caching?

Consider the following code: #define _GNU_SOURCE #include <unistd.h> #include <sys/syscall.h> #include <stdio.h> int main() { pid_t tid = gettid(); printf("tid: %d"...
Schrodinger ZHU's user avatar
1 vote
0 answers
30 views

Finding pid for python script B execution on a terminal using popen from python script A

I have a python script "A" that uses subprocess.Popen to launch a gnome-terminal and then executes a different python script "B" in there. I am stuck with retrieving the pid for ...
blackbeard's user avatar
0 votes
0 answers
46 views

Why Java CPU usage show different inside node vs portal?

I am trying to find out answer to that problem. Cluster has 5 nodes (on autoscaling mode), nodes are 8CPU, 64G RAM. When I get inside 2 nodes I see 100% CPU taken by java process (java is taking only ...
Michał Picheta's user avatar
0 votes
0 answers
7 views

how to calculate Live threat of any process using shell commands?

how to calculate Live threat of any process using shell commands? i need help it is just like jconsole thread monitor. please help me out to get someone can to get live . peak and total thread monitor ...
vishal Kumar's user avatar

15 30 50 per page
1
2 3 4 5
115