1/60
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
fork() command in C++
When fork() is called, it creates a copy of the parent process. It returns 0 to the child process and the child's PID to the parent process.
fork() return to a Child
Returns 0.
fork() return to a Parent
Returns the child's PID.
fork() return on fail
Returns a negative number, likely -1.
wait() function
Waits for a child process to finish before continuing.
Variables before fork()
Available to both parent and child, but modifications in one process do not affect the other due to separate memory spaces.
Number of children: fork(); fork();
Four children will be created.
Data structure of a pipe
A structure that allows a child or parent to read and write data.
Index of the reading end in a pipe
When the parent process receives data from the child process
Variable type for a pipe
An int array of size 2.
Reading from an empty pipe
The program waits or stalls until data is put into the pipe.
Multiple processes reading from a pipe
False. Only one is able to read.
Transferring data back and forth using a single pipe
False.
Writing multiple data types into a pipe
It can cause confusion.
Closing pipes
To prevent processes from waiting indefinitely for data, stops processes.
CFS
Short for Central Focus Scheduling. Niceness values (-20 to 19) affect process scheduling, with higher values being 'better' for non-real-time tasks.
Niceness: Higher or Lower?
lower niceness is better.
Real Time Process Scheduling Types
FIFO (First In, First Out) and RR (Round Robin). FIFO runs until blocked or forced to stop. RR is similar to FIFO but gives time slices.
Priority of Scheduler Types
Real-time (RR) takes priority.
Signal Received
Acts as an interrupt to the process.
Catching Signals (SIGINT, SIGTERM)
To inform the user where the process has reached.
Generic Signal Without a Catch
The process gets killed.
Blocking or Catching Signals
True, some signals cannot be blocked or caught.
Function to Send a Signal in C
kill function.
Pointer
A variable that stores the memory address of another variable.
Pointer Code
int n = 2; int *nPtr = &n; *nPtr = *nPtr * 2;
Data Structures using Pointers
It may be faster.
fork() command in C++
When fork() is called, it creates a copy of the parent process. It returns 0 to the child process and the child's PID to the parent process.
fork() return to a Child
Returns 0.
fork() return to a Parent
Returns the child's PID.
fork() return on fail
Returns a negative number, likely -1.
wait() function
Waits for a child process to finish before continuing.
Variables before fork()
Available to both parent and child, but modifications in one process do not affect the other due to separate memory spaces.
Number of children: fork(); fork();
Four children will be created.
Data structure of a pipe
A structure that allows a child or parent to read and write data.
Index of the reading end in a pipe
When the parent process receives data from the child process
Variable type for a pipe
An int array of size 2.
Reading from an empty pipe
The program waits or stalls until data is put into the pipe.
Multiple processes reading from a pipe
False. Only one is able to read.
Transferring data back and forth using a single pipe
False.
Writing multiple data types into a pipe
It can cause confusion.
Closing pipes
To prevent processes from waiting indefinitely for data, stops processes.
CFS
Short for Central Focus Scheduling. Niceness values (-20 to 19) affect process scheduling, with higher values being 'better' for non-real-time tasks.
Niceness: Higher or Lower?
Higher niceness is better.
Real Time Process Scheduling Types
FIFO (First In, First Out) and RR (Round Robin). FIFO runs until blocked or forced to stop. RR is similar to FIFO but gives time slices.
Priority of Scheduler Types
Real-time (RR) takes priority.
Signal Received
Acts as an interrupt to the process.
Catching Signals (SIGINT, SIGTERM)
To inform the user where the process has reached.
Generic Signal Without a Catch
The process gets killed.
Blocking or Catching Signals
True, some signals cannot be blocked or caught.
Function to Send a Signal in C
kill function.
Pointer
A variable that stores the memory address of another variable.
Pointer Code
int n = 2; int *nPtr = &n; *nPtr = *nPtr * 2;
Data Structures using Pointers
It may be faster.
Data Structures using Pointers
It may be faster.
Real Time Process Scheduling Types
FIFO (First In, First Out) and RR (Round Robin). FIFO runs until blocked or forced to stop. RR is similar to FIFO but gives time slices.
Fork() returns to child
Returns 0 to the child process
Function to sena a signal in C
kill function
The process gets killed
Generic signak without a catch
False
Multiple process reading from a pipe is ?
Higher niceness is better
Niceness: Higher or Lower?