2019 U2 Q5

Part a

Non Pre-emptive scheduling runs processes on a first come first serve basis,  pre-emptive scheduling determines the length of time  the processes will take to be executed , and then executes the shortest process first, followed by the next shortest and so on. Pre-emptive scheduling can also be accomplished by other algorithms , e.g round robin.

(See this note1)

Part b(i)

The process’s instruction from it’s local program counter is placed on the CPU and executed one after the other until an interrupt is generated.

Part b(ii)

The process scheduler prepares to move the process of the CPU. The process’ updated program counter and state information is saved to its process control block, the process is now in the “ready” queue.

Part b(iii)

The process is interrupted by an I/O or event interrupt. The process’ updated program counter and state information is saved to its process control block, it is placed in the “waiting” queue  to wait for an I/0 or event completion.

Part b(iii)

The process is moved to the ready queue from the  waiting queue.  If the process was waiting on an I/O operation, it’s PCB and local memory would be  updated before it was moved to the ready queue.

Part c

The interrupt is a scheduling one, P5’s program counter and other information is saved to its PCB.  P5 is put into  a “ready” state since it was not blocked by IO or another event.

P2’s instruction from its Program counter is put on the cpu for execution, P2’s  PCB is updated to “running” . P2 will run to completion assuming no error interrupts are generated. When P2 is complete, it’s state is set to terminated. Assuming that there are no other high priority tasks to be run than P5, P5 will be go from ready to running, and it’s instructions are executed from it’s program counter until it terminates and enters a terminated state.

Part d

R0 is locked to P0, it cannot be accessed.

P1 wants to access R1, because it is locked to P0.

For P1 to access R0, P0 must run to completion and terminate.

However, P0 is waiting on P1 to complete in order to access R1  (Which is locked to P1 in the diagram)

Thus both processes cannot run to completion since the resources they need are locked  either one.  This produces a deadlock.

Part e

Advantages:

Advanced operations can be performed at the command line.

For an advanced user, It is faster than using a gui

It is uses comparatively less system resources.

Disadvantages:

It is difficult to learn and use for an inexperienced user.

Unable to perform multitasking.

Part f

Encrypt the files.

Password protect the files.

Employ the use of access permissions to the sender and receiver only to be able to access the file.

Send over a reliable medium which can verify and ensure that the file was sent I.e the use of an application layer protocol running over a connection oriented protocol, e.g using an email client which implements SMTP which in turn uses the IP TCP. 

Table of Contents

  1. Part a
  2. Part b(i)
  3. Part b(ii)
  4. Part b(iii)
  5. Part b(iii)
  6. Part c
  7. Part d
  8. Part e
  9. Part f
  10. Table of Contents
  11. Footnotes

Footnotes

  1. https://islandclass.wordpress.com/2021/05/12/scheduling-algorithms/ ↩︎

© 2023  Vedesh Kungebeharry. All rights reserved. 

Leave a comment