You are on page 1of 5

● What are the reasons for providing an environment that allows process

cooperation?(MID).

Answer: There are several reasons for providing an environment that allows process cooperation:

1. Information sharing: Facilitating concurrent access to shared data like files among multiple
users.
2. Computation speedup: Breaking tasks into subtasks for parallel execution, enhancing
performance with multiple processing elements.
3. Modularity: Structuring the system into separate processes or threads for better organization.
4. Convenience: Supporting multitasking for individual users, allowing simultaneous activities
like editing, printing, and compiling.

● What resources are used when a thread is created? How do they differ from those used
when a process is created?(MID)
Answer:
Because a thread is smaller than a process, thread creation typically uses fewer resources than
process creation. Creating a process requires allocating a process control block (PCB), a rather
large data structure. The PCB includes a memory map, list of open files, and environment
variables. Allocating and managing the memory map is typically the most time-consuming
activity. Creating either a user or kernel thread involves allocating a small data structure to hold
a register set, stack, and priority.

● What are two differences between user-level threads and kernel-level threads? Under
what circumstances is one type better than the other?(MID)
Answer:
a. User-level threads are unknown by the kernel, whereas the kernel is aware of kernel threads.
b. On systems using either M:1 or M:N mapping, user threads are scheduled by the thread library
and the kernel schedules kernel threads.
C. Kernel threads need not be associated with a process whereas every user thread belongs to a
process. Kernel threads are generally more expensive to maintain than user threads as they must
be represented with a kernel data structure.

● What is a process? Describe the different states of a process using state diagram.(MID)

Ans:A process is a program in execution. As a process executes, it changes state. The


state of a process is defined by that process’s current activity. Each process may
be in one of the following states: new, ready, running, waiting, or terminated.

● What is the purpose of the command interpreter? Why is it usually separate from the
kernel?Would it be possible for the user to develop a new command interpreter using the
system-call interface provided by the operating system?(MID)

Answer: It reads commands from the user or from a file of commands and executes them,
usually by turning them into one or more system calls. It is usually not part of the kernel since
the command interpreter is subject to changes.
Yes, it's possible for a user to develop a new command interpreter using the system-call Interface
provided by the operating system.
This would involve writing code to interact with the system calls provided by the OS to execute
commands, manage processes, handle input/output, and perform other necessary tasks for
interpreting commands.

● Distinguish between the client-server and peer-to-peer models of distributed


systems.(MID)

Answer:
The client-server model firmly distinguishes the roles of the client and server. Under this model,
the client requests services that are provided by the server. The peer-to-peer model doesn't have
such strict roles. In fact, all nodes in the system are considered peers and thus may act as either
clients or servers or both. A node may request a service from another peer, or the node may in
fact provide such a service to other peers in the system.

● What are the five major activities of an operating system with regard to process
management?(MID)
Answer:
a. The creation and deletion of both user and system processes
b. The suspension and resumption of processes
c. The provision of mechanisms for process synchronization
d. The provision of mechanisms for process communication
e. The provision of mechanisms for deadlock handling

● In what ways is the modular kernel approach similar to the layered approach? In what
ways does it differ from the layered approach?(MID)

Answer: The modular kernel approach requires subsystems to interact with each other through
carefully constructed interfaces that are typically narrow (in terms of the functionality that is
exposed to external modules). The layered kernel approach is similar in that respect. However,
the layered kernel imposes a strict ordering of subsystems such that subsystems at the lower
layers are not allowed to invoke operations corresponding to the upper-layer subsystems. There
are no such restrictions in the modular-kernel approach, wherein modules are free to invoke each
other without any constraints.

● What are the three major activities of an operating system with regard to memory
management?
Answer: The three major activities are:
a. Keep track of which parts of memory are currently being used and by whom.
b. Decide which processes are to be loaded into memory when memory space becomes available.
c. Allocate and deallocate memory space as needed.

● What are the two models of interprocess communication? What are the strengths and
weaknesses of the two approaches?
Answer: The two models of interprocess communication are message-passing model and the
shared-memory model. Message passing is useful for exchanging smaller amounts of data,
because no conflicts need be avoided. It is also easier to implement than is shared memory for
intercomputer communication. Shared memory allows maximum speed and convenience of
communication, since it can be done at memory transfer speeds when it takes place within a
computer. However, this method compromises on protection and synchronization between the
processes sharing memory.

● 10. Consider a multiprocessor system and a multithreaded program written using the
many-to-many threading model. Let the number of user-level threads in the program be
more than the number of processors in the system. Discuss the performance implications
of the following scenarios.
a. The number of kernel threads allocated to the program is less than the number of processors.
b.The number of kernel threads allocated to the program is equal to the number of processors.
c. The number of kernel threads allocated to the program is greater than the number of
processors but less than the number of user-level threads.
Answer:
a) When the number of kernel threads is less than the number of processors, then some of the
processors would remain idle since the scheduler maps only kernel threads to processors and not
user-level threads.
b) When the number of kernel threads is exactly equal to the number of processors, then it is
possible that all of the processors might be utilized simultaneously. However, when a kernel-
thread blocks inside the kernel (due to a page fault or while invoking system calls), the
corresponding processor would remain idle.
c) When there are more kernel threads than processors, a blocked kernel thread could be
swapped out in favor of another kernel thread that is ready to execute, thereby increasing the
utilization of the multiprocessor system.

Describe the differences between symmetric and asymmetric multiprocessing. What are three
advantages and one disadvantage of multiprocessor systems?

Answer: Symmetric processing treats all processors as equals; I/O can be processed on any of
them. Asymmetric processing designates one CPU as the master, which is the only one capable
of performing I/O; the master distributes computational work among the other CPUs.
Advantages: Multiprocessor systems can save money, by sharing power supplies, housings, and
peripherals. Can execute programs more quickly and can have increased reliability.
Disadvantages: Multiprocessor systems are more complex in both hardware and software.
Additional CPU cycles are required to manage the cooperation, so per- CPU efficiency goes
down.

Describe three general methods for passing parameters to the operating system.
Answer: The three general methods used to pass parameters to the operating system during
system calls are the register-based method, stack-based method, and memory-based method.
Three General Methods Used to Pass Parameters to the Operating System During System Calls:

1. Register-based method: In this method, parameters are passed to the operating system by
storing them in designated registers. For example, the x86 architecture uses the EAX,
EBX, ECX, and EDX registers to pass parameters.
2. Stack-based method: Here, parameters are placed on the stack and then accessed by the
operating system. The stack pointer is used to keep track of the parameters.
3. Memory-based method: In this method, parameters are stored in a designated memory
location, and the operating system accesses them from that memory location.

You might also like