3 - Chapter3 n Systems n ,asystem ischaracte

Info icon This preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 3
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Reference Model of Real-Time  Systems n A reference model focuses on  the  timing properties  and  resource requirements  of system components and  the way  the operating system  allocates the  available system resources  among them.
Image of page 2
Reference Model of Real-Time  Systems n According to the reference model, a system  is characterized by: n   A  workload model  that describes the  applications supported by the system n   A  resource model  that describes the  system resources available to the application n   Algorithms  that define how the application  system uses the resources at all times.
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Processors and Resources n System resources: processors and resources n Processors –  active resources   Pn n Examples: CPUs, transmission lines, disks n Resources –  passive resources  Rm n Examples: memory, sequence number, database locks n Examples: computation job shares data with other  computations, data guarded by semaphores;  communication ACK sequence number
Image of page 4
Critical Regions n While the CPU protects itself against  simultaneous use, the code that interacts with  the other serially reusable resources cannot.   Such code is called a  critical region .   n If two tasks enter the same critical region  simultaneously, a catastrophic error occur.
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Semaphores n The most common methods for protecting  critical regions involves a special variable  called a  semaphore . n A semaphore S is a memory location that acts  as a lock to protect critical regions. n Two operations: wait P(S), signal V(S)
Image of page 6
Semaphores n Code that enters a critical region is bracketed  by calls to wait and signal.  This prevents more  than one process from entering the critical  region. n The wait operation suspends any program  calling until the semaphore S is FALSE,  whereas the signal operation sets the  semaphore S to FALSE.
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
void P(int S) { while (S == true); S = true; } void V(int S) { S = false; } Semaphore is initialized to false. Process_1 . . . P(S) critical region V(S) . . . Process_2 .
Image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern