1
Q:

main()

{

fork();

 

printf(“Hello World!”);

}

Output for the above unix program is

A) Hello World! B) Hello World!Hello World!
C) Hello World D) None

Answer:   B) Hello World!Hello World!



Explanation:

The fork creates a child that is a duplicate of the parent process. The child begins from the fork().All the statements after the call to fork() will be executed twice.(once by the parent process and other by child). The statement before fork() is executed only by the parent process

Subject: Operating Systems
Exam Prep: GRE
Q:

Which among the following is a system call used for process management

A) fork() B) exec()
C) getppid() D) All the above
 
Answer & Explanation Answer: D) All the above

Explanation:

All the above listed are the System calls for process management

Report Error

View Answer Report Error Discuss

Filed Under: Operating Systems
Exam Prep: GATE
Job Role: Software Architect

0 4348
Q:

Explain fork() system call?

Answer

The `fork()’ 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. We can tell which is which by checking the return value from `fork()’. The parent gets the child’s pid returned to him, but the child gets 0 returned to him.

Report Error

View answer Workspace Report Error Discuss

Subject: Operating Systems Exam Prep: GATE

2 6394
Q:

Which among the following are not the children of Swapper or Scheduler?

A) Process Dispatcher B) Vhand
C) Dbflush D) All the above
 
Answer & Explanation Answer: D) All the above

Explanation:

Process Dispatcher,Vhand,Dbflush are the children of Scheduler

Report Error

View Answer Report Error Discuss

Filed Under: Operating Systems
Exam Prep: GATE

0 3941
Q:

What is a shell?

Answer

A shell is an interactive user interface to an operating system services that allows an user to enter commands as character strings or through a graphical user interface. The shell converts them to system calls to the OS or forks off a process to execute the command. System call results and other information from the OS are presented to the user through an interactive interface. Commonly used shells are sh,csh,ks etc.

Report Error

View answer Workspace Report Error Discuss

Subject: Operating Systems Exam Prep: GATE

1 2136
Q:

What is a drawback of MVT?

Answer

1) ability to support multiple processors
2) virtual storage
3) source level debugging

Report Error

View answer Workspace Report Error Discuss

1 4164
Q:

What is pre-emptive and non-preemptive scheduling?

Answer

Preemptive scheduling: The preemptive scheduling is prioritized. The highest priority process should always be the process that is currently utilized.


Non-Preemptive scheduling: When a process enters the state of running, the state of that process is not deleted from the scheduler until it finishes its service time.

Report Error

View answer Workspace Report Error Discuss

0 2838
Q:

What is a daemon?

Answer

Daemon is a program that runs in the background without user’s interaction. A daemon runs in a multitasking operating system like UNIX. A daemon is initiated and controlled by special programs known as ‘processes’.

Report Error

View answer Workspace Report Error Discuss

0 2831
Q:

What is cycle stealing?

Answer

We encounter cycle stealing in the context of Direct Memory Access (DMA). Either the DMA controller can use the data bus when the CPU does not need it, or it may force the CPU to temporarily suspend operation. The latter technique is called cycle stealing. Note that cycle stealing can be done only at specific break points in an instruction cycle.

Report Error

View answer Workspace Report Error Discuss

2 7825