I’m having some trouble with this program. I know what a fork() function does. It is used to create a new process from an existing process. The new process is called the child process, and the existing process is called the parent. The parent returnes the child’s pid and the child returns 0. That said, I find hard to understand
Tag: process
Limit a set of processes’ CPU and memory usage
Browsing the web has low priority for me, and so I would like all the processes that deal with it to be low priority, too. Is this approach a valid one? Open a console window with the nice command. Launch the browser from this console. Will the program launched from this console inherit the niceness of the console itself? Answer
Programmatically monitor process state using C++
I have to develop an application in C++ to monitor the state of processes in my Linux system and also need to know if a new process is created or an existing process is terminated. Is there an API available for this? Also it will be helpful if someone could tell me how to start it with. Answer inotify works
Proper implementation of an inter process communication (IPC)
Is the following a proper implementation of an inter-process communication? It seems to be working but I’m wondering if there could be a race condition leading to hanging. One constraint is that both processes need to be started independently and in any order. Answer Some stress tests showed no problem so the implementation seems OK if somebody wants to reuse
Process management code behaves different on Linux and Windows – Why?
(Context) I’m developing a cross-platform (Windows and Linux) application for distributing files among computers, based on BitTorrent Sync. I’ve made it in C# already, and am now porting to C++ as an exercise. BTSync can be started in API mode, and for such, one must start the ‘btsync’ executable passing the name and location of a config file as arguments.
Start a process in Go and detach from it
I need to start a new process in Go with the following requirements: The starting process should run even after the Go process is terminated I need to be able to set the Unix user/group that’s running it I need to be able to set the environment variables inherited I need control over std in/out/err Here is an attempt: This
Linux, waitpid, WNOHANG, child process, zombie
I running my program as daemon. Father process only wait for child process, when it is dead unexpected, fork and wait again. But when child process being killed with -9 signal, the child process goes to zombie process. waitpid should return the pid of child process immediately! But waitpid got the pid number after about 90 seconds, Here is the
How does the fork() know whether it is in child process and in parent process? [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 9 years ago. Improve this question When a fork() system call gets executed , the processor turns into kernel mode. Thus at the end of the
Process permanently stuck on D state [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question
How to terminate process from Python using pid?
I’m trying to write some short script in python which would start another python code in subprocess if is not already started else terminate terminal & app (Linux). So it looks like: Have problem of lacking knowledge to name proces by pid which app reads from file “.proc”. The other problem is that interpreter says that string named dat is