View on GitHub

os202

OS202


Home
A simple Overview of this week:

Source:Here

Top 10 List Week 06:

1.Concurrency
In short, Concurrency means doing/executing multiple program instruction at the same time. More information regarding difficulties in the link.
2.Fork System Call
Fork is a syscall which is used to create a new process called a child process which will be discussed next. Both parent and child will be executed simultaniously.
The Process will return either:
Positive Value(Process ID of child process)
0 (Return child process)
Negative Value(Fork Failed)
3.Child Process
Child Process is a duplicate process of the caller with the same program counter, cpu register, and instruction to execute. Variable change is kind of “local” to a process, for example in the child, i is modified from 1 to 2, for parent’s instruction execution the i value is still the same(1) while only the child is impacted.
4.Process ID(PID)
Process ID or in short PID is a unique number which identifies a process to the system. The most common use for it is the process killing purposes.
5.Fork in Windows
What i found out is that fork() doesn’t compile within Windows Environment as it is only present in LINUX or UNIX Library. Here is an answer by John Stephenson if you want an “equivalent” on Windows
6.Parent Process ID (PPID)
Parent Process ID is quite simple actually, the PID of the parent’s process from a child process’s perspective.Why is it important? The most effective way to kill a “zombie”process(Process that is dead but still running which takes up memory/resource)is to track the parent process and kill it.
7.What Does PPID 1 Means?
Some users describe it in a nutshell here.But if you need a more comprehensive idea as to why, if the parent is “dead”/finished before the child then the child will have a PPID of 1 which is the init/father of all process.
8.Wait System Call
Wait is as it name implies, wait the upcoming instruction within the parent’s process until the child process is terminated/finished.The return value could vary, if only 1 child exist, then it will return the child PID.If there is more than 1 child, look into the link above for more info.
9.fflush
Flush is as it names implies, flushes the output buffer and move it to the console or disk.
10.How to terminate a process
As it is pointed out above, PID is important to kill a process, the link above shows how to kill a process. It is much easier to kill a process with PID as it doesn’t cause ambiguity with similar process name as PID is unique.