Chapter 7 Flashcards

1
Q

Does fork return child 0 and parent process child process id

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What exec do

A

It takes 1 parameter. The process who call exec will be terminated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is wait system call

A

The wait system call suspends the calling process until one of its immediate children terminates. On success of wait call, terminated child process process ID is returned.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is zombie state

A

If a process creates its children. And then parent process get terminated then child process comes in zombie state. Child process can not send its exit call to its parent process. And then the ownership of child process goes to init process who its grand parent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Child process sends a exit call to which process on termination

A

Its parent process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What parameter should be passed to exit it is terminates normally

A

0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What parameter should be passed to exit it is terminates abnormally

A

non-zero value (positive integer)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is exec() call

A

Typically the exec system call is used after a fork system call by child or parent process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Can we return from successful exec() call and if no then why

A

No. Because the calling process image is overlaid by the new process image

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is fork call

A

System call fork() is used to create processes. It takes no arguments and returns a process ID. The purpose of fork() is to create a new process, which becomes the child process of the caller. After a new child process is created, both processes will execute the next instruction following the fork() system call. Therefore, we have to distinguish the parent from the child. This can be done by testing the returned value of fork():

    If fork() returns a negative value, the creation of a child process was unsuccessful.
    fork() returns a zero to the newly created child process.
    fork() returns a positive value, the process ID of the child process, to the parent.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What ls -l do

A

Display long listing of directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is cooperating processes

A

An independent process cannot affect or be affected by the execution of another process. But cooperating process can affect or be affected by the execution of another process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are advantages of cooperating processes

A
  • Information sharing
  • Computation speed
  • Modularity
  • Convenience
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is producer-consumer problem

A

It is problem of cooperating processes. Producer produces information and place in a fixed size buffer, that is consumed by a consumer process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly