Solution:
Race condition can be defined as a condition where some shared data is read and written by more than one process at a time and the result. In order to avoid a race condition situation the threads which are involved in concurrent operations over shared data need to synchronize their turns when acting on data. Suppose if the ready queue is implemented as a linked list and if during and interrupt handling if the linked list is manipulated. The interrupts need to be disabled in order to prevent another interrupt before its work is done. If not disabled the interrupts will cause corruption to the ready queue.
One way of doing so is by implementing mutual exclusion. Basically it means that at a given point of time only one process can use the shared data for read / write purposes while other processes will be have to wait i.e. excluded from accessing the shared space. Once the process has finished executing the shared space the other processes in waiting should be allowed to start. However there will be a priority system to check that the correct process gets the chance. The primary conditions for mutual exclusion are:
how interrupt could block other process to access the critical section ?
4. For the code below, remember the scheduler could interrupt any process at any time to schedule another and we never know whether the child or parent will execute first after a "fork". List all possible strings this program could generate as output. Show your work. pidl fork (); pid2 fork() if (pidl&& pid2) printf ("A"); printf ("B");
Why is the process state (i.e., PC, SP, EFLAGS, general registers) kept in the Kernel Interrupt Stack before handling an Interrupt? Why could we not store it in the user memory? What is the risk?
How could blocking all ICMP traffic protect you? Could you still access some websites with your Port 80 rule enabled? Why? Why would you want to allow incoming (not outgoing) Port 443, but block incoming Port 80? Could malware rename itself in order to get through a firewall? Why would this work?
when using microcontroller 8051 How do you think are other interrupts processed while running the interrupt handler?
Challenge Question One On a system with paging, a process cannot access memory that it does not own. Why? How could the operating system allow access to other memory? Why should it or should it not? Challenge Question Two What is the purpose of paging the page tables?
The following code fragment is a 2-process "solution" to the critical section problem try [i] = true ; while (incs[j]) no-op; while (turn=j and try[j]) no-op; incs [i] = true ; critical section try [i] = false; incs [i] = false; turn = j ; Does the above "solution" meet all 3 conditions of critical sections? Please explain your answer.
What is Role-based Access Control? How is it implemented? How does it simplify access control process?
Assume the access time for an L2 cache with a 64 byte cache block is 20 cycles for the 1st 64 bit (8 byte) word, and an additional 2 cycles for each subsequent word. What is access time (time before L1 can pass incoming data on to processor) for a read of a word at 5ed705 if the full block must be read before using data? With critical word first? With early restart?
I. What is the use of a process table in program execution? II. What is the difference between a process that is ready and a process that is waiting? III. What complications could arise in timesharing/multitasking system if two processes require access to the same file at the same time? Are there cases such request should be granted? Are there cases such request should be denied? I. What are the various functions of the memory manager in an operating system?...