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:

Explain the meaning of mutex.

Answer

Mutex is the short form for ‘Mutual Exclusion object’. A mutex allows multiple threads for sharing the same resource. The resource can be file. A mutex with a unique name is created at the time of starting a program. A mutex must be locked from other threads, when any thread that needs the resource. When the data is no longer used / needed, the mutex is set to unlock.

Report Error

View answer Workspace Report Error Discuss

0 3075
Q:

Explain the concept of the Distributed systems?

Answer

Distributed systems work in a network. They can share the network resources, communicate with each other.

Report Error

View answer Workspace Report Error Discuss

0 2248
Q:

What is Memory-Management Unit (MMU)?

Answer

Hardware device that maps virtual to physical address. In MMU scheme, the value in the relocation register is added to every address generated by a user process at the time it is sent to memory.


->The user program deals with logical addresses; it never sees the real physical addresses

Report Error

View answer Workspace Report Error Discuss

0 1946
Q:

Differentiate between Complier and Interpreter?

Answer

An interpreter reads one instruction at a time and carries out the actions implied by that instruction. It does not perform any translation. But a compiler translates the entire instructions

Report Error

View answer Workspace Report Error Discuss

0 2659
Q:

What is logical and physical addresses space?

Answer

Logical address space is generated from CPU; it bound to a separate physical address space is central to proper memory management. Physical address space is seen by the memory unit. Logical address space is virtual address space. Both these address space will be same at compile time but differ at execution time.

Report Error

View answer Workspace Report Error Discuss

1 1698
Q:

What are necessary conditions for dead lock?

Answer

1. Mutual exclusion (where at least one resource is non-sharable)


2. Hold and wait (where a process holds one resource and waits for other resource)


3. No preemption (where the resources can’t be preempted)


4. Circular wait (where p[i] is waiting for p[j] to release a resource. i= 1,2,…n


j=if (i!=n) then i+1


else 1 )

Report Error

View answer Workspace Report Error Discuss

0 2094
Q:

What is CPU Scheduler?

Answer

Selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them. CPU scheduling decisions may take place when a process: 1.Switches from running to waiting state. 2.Switches from running to ready state. 3.Switches from waiting to ready. 4.Terminates. Scheduling under 1 and 4 is non-preemptive. All other scheduling is preemptive.

Report Error

View answer Workspace Report Error Discuss

2 1993
Q:

What is Dispatcher?

Answer

Dispatcher module gives control of the CPU to the process selected by the short-term scheduler; this involves: Switching context, Switching to user mode, Jumping to the proper location in the user program to restart that program, dispatch latency – time it takes for the dispatcher to stop one process and start another running.

Report Error

View answer Workspace Report Error Discuss

0 3577