difference between User mode and the kernel mode is that the User mode is less
privileged mode and has no access to the kernel instruction or protected memory
and user programs run in this mode whereas, the kernel mode is more privileged
mode as the kernel instructions are executable and protected memory areas are
of the most common events that lead to a process switch is multitasking, when
the CPU needs to switch processes in and out of memory, that than one process
can be running. Another common event is the kernel/user switch, when switching
between user and kernel mode, it may be used but this is not always necessary.
Interrupts is also another common event, when the CPU is interrupted to return
data from a disk read.
way in which the thread is different from the process is that, thread is used
for scheduling and execution, execution path possibly interleaved with other
process, also dispatcher/scheduler decides which process is executed when.
Whereas, process is known for the resource ownership, memory space where
process image is held and OS-allocated additional resources. Also threads are used for small tasks whereas
processed are used for heavier tasks.
are two main types of operations that can be performed using the semaphores.
One of these operation is semWait, this operation reduces the semaphore value, therefore,
if the value is being displayed as a negative, the process that is executing
semWait will recognise and become blocked, however, if it fails to get blocked,
the whole process will start the execution. The other operations that can be
performed using the semaphores is the semSignal this operation increases the
semaphore value, furthermore, if the value returned is less than or equal to
zero then the blocked process by semWait will become unblocked. Binary
semaphores are used to to implement locks.
difference between deadlock, livelock and starvation is that, deadlock is when
two or more processes are unable to proceed because each is waiting for one of
the others to do something. While, a livelock is similar to deadlock, there are
some difference like that the states involved in the process of the livelock frequently
change with regards to one another, and none progressing. Furthermore,
unresolved deadlocks lead to starvation, deadlocked processes will never be
chosen by the scheduler since they are blocked while waiting on each other.
main benefit of dynamic partitioning is that it allows for the resources to be
manually moved to, from, and between running logical partitions without
shutting down or restarting the logical partitions. The drawback of dynamic
partitioning is that when the processes finish and new process are brought in,
the main memory becomes more and more disjointed, and memory use declines. It can be addressed via compaction where OS
periodically shifts processes so that they are contiguous. However, this is time
purpose of introducing multilevel queue scheduling is to help with the
situations in which processes are easily classified into different groups. For
different processes, example of this would be interactive and batch processes,
as these two are different types of processes they may have different
scheduling requirements, this is where multilevel comes in and it organises the
processes to the right queue. The purpose of introducing inverted page tables
is to solve problems where tables may consume large amounts of physical memory,
to solve this we can use inverted page tables which has one entry for each real
frame of memory. The difference between a standard and inverted page table is,
standard page table contains an element for each virtual page and a table is
for each process. Whereas, inverted page table has only one-page table of its
way in which the use of priorities in scheduling can lead to starvation is where
a high priority process will run before the low priority process. If the high
process fails to block the low process, the low process may never be scheduled
leading it to experience starvation. One way in which starvation can be
prevented is through the use modern scheduling which normally contains code that
will allow all processes to receive a minimum amount of the important resource
in order to prevent any process from suffering from starvation.
memory access is feature that allows input or output device to send or receive
data directly to or from the main memory. DMA allows the bypassing of the CPU
to speed up the memory operations. This DMA feature is managed by a chip named
DMA controller. One reason why the direct memory access can be useful is
because it allows high transfer rates and fewer CPU cycles for each transfer.
reason why it takes less, on average, to find a record in an indexed sequential
file than in a sequential file is because a sequential file, the records are
all stored in order and have a fixed format however, when we perform search, it
will go though every record sequentially until it has matched. On the other
hand, when it comes to an indexed sequential file they do not take as much time
on average than sequential file, they have an index that is able to waste very
less time to find a record which is based on its key.