• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 1 fuera de 11 páginas
Examen

Cos3721 Assignment 3 2023

Document preview thumbnail
Vista previa 1 fuera de 11 páginas

COS3721 A3 - Good marks guaranteed Operating Systems And Architecture (University of South Africa) lOMoARcPSD| COS3721 Assignment 3 2022 Unique No.: Due Date: 19 September 2022 lOMoARcPSD| Preview … Question 1 a) Probability of 1 failure of 1000 hard disk = 750,000/1000 = 750 hrs So, 750/24 = 31.25 days So answer is approx. one in a month. b) 1 million hours is approximately 114 years, but we cannot say that warranty of product is 114 years, MBTF is a experiment and statistical approach to find the mean time between the failures But we can find using below formula what is the probability of product performing of certain years without failure R(t) = e –t/mtbf therefore probabilities for lasting years are given below 1 year %R(1) = 100 * e –8760hrs /1 million = 99.12 similarly for 2 years 98.26% 3 years 97.40% and so on.. Downloaded by Genial Adventures () lOMoARcPSD| Question 1 a) Probability of 1 failure of 1000 hard disk = 750,000/1000 = 750 hrs So, 750/24 = 31.25 days So answer is approx. one in a month. b) 1 million hours is approximately 114 years, but we cannot say that warranty of product is 114 years, MBTF is a experiment and statistical approach to find the mean time between the failures But we can find using below formula what is the probability of product performing of certain years without failure R(t) = e –t/mtbf therefore probabilities for lasting years are given below 1 year %R(1) = 100 * e –8760hrs /1 million = 99.12 similarly for 2 years 98.26% 3 years 97.40% and so on.. Downloaded by Genial Adventures () lOMoARcPSD| Question 2 2.1. Downloaded by Genial Adventures () lOMoARcPSD| 2.2. #include iostream #include queue #include stdlib.h using namespace std; //structure for a timer request struct TimerRequest { int processID; //process ID int time; //time //comparison operator for priority queue bool operator()(const TimerRequest& t1, const TimerRequest& t2) { return ; } }; //virtual clock class class VirtualClock { private: priority_queueTimerRequest, vectorTimerRequest, TimerRequest timerQueue; //priority queue of timer requests public: //constructor VirtualClock() { } //add a timer request to the queue void addTimerRequest(int processID, int time) { TimerRequest temp; ssID = processID; = time; timerQ(temp); } //get the next timer request from the queue TimerRequest getNextTimerRequest() { TimerRequest temp = timerQ(); timerQ(); return temp; } //check if the queue is empty bool isEmpty() { return timerQ(); } }; int main() { //create a virtual clock lOMoARcPSD| VirtualClock vc; //add some timer requests TimerRequest(1, 10); TimerRequest(2, 5); TimerRequest(3, 15); //get and print the next timer request TimerRequest tr = NextTimerRequest(); cout"Process ID: "ssID", Time: "endl; //get and print the next timer request tr = NextTimerRequest(); cout"Process ID: "ssID", Time: "endl; //get and print the next timer request tr = NextTimerRequest(); cout"Process ID: "ssID", Time: "endl; //check if the queue is empty if(Empty()) cout"Queue is empty"endl; else cout"Queue is not empty"endl; system("pause"); return 0; } Explanation: • A timer that is implemented in software and serves the purpose of keeping track of the passage of time within a computer system is referred to as a virtual clock. The processes and applications currently executing on the system generate timer requests, and the virtual clock is responsible for storing these requests in a queue and managing them. The correct and effective management of time within the system is ensured by the utilization of the virtual clock in this manner. • In most cases, the hardware of a computer system has access to three different timer channels. The virtual clock makes use of these channels in order to queue and otherwise manage timer request messages. The timer requests are kept in the virtual clock's priority queue, which sorts the requests based on the times they were sent. As a result, the requests for the timer will be processed in the appropriate sequence. • When a timer request is made, the process or application that makes the request sends the time at which the request should be processed to the virtual clock. This ensures that the request is dealt with at the appropriate moment. The request is placed in a queue by the virtual clock, which then manages it based on the time that was provided. The virtual clock works in this way to ensure that timer requests are processed accurately and in a timely manner. • A computer's virtual clock is an essential component because it ensures that time is handled in an accurate and effective manner across the entire system. Without a virtual clock, processes and applications would be unable to make appropriate use of timers, which would result in the system as a whole being unable to operate in an appropriate manner.


Libro relacionado
 image
Editorial: 1990 ISBN: 9780201509397 Edición: Desconocido

Información del documento

Subido en
8 de febrero de 2023
Número de páginas
11
Escrito en
2022/2023
Tipo
Examen
Contiene
Preguntas y respuestas
$2.85

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
LIBRARYpro
3.7
(1511)
Vendido
10814
Seguidores
4905
Artículos
5071
Última venta
4 días hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes

Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.