7 a thread is a subunit of a process that can be

This preview shows page 1 - 3 out of 7 pages.

7. A thread is a subunit of a process that can be executed and scheduled independently. Threads share all resources allocated to their parent processes with other threads in the same process, including primary storage, files, and I/O devices. 8. Commonly used methods include first-come first-served (FCFS), shortest time remaining (STR), and explicit priority. With FCFS, the scheduler dispatches the thread that has been waiting the longest; with this method, the run queue is ordered by wait time. With STR, the next thread to be dispatched is based on the expected amount of CPU time needed to
Image of page 1

Subscribe to view the full document.

complete the process. Creating, updating, and using time-to-completion information increases system overhead, so this method isn’t used often. Explicit priority dispatches threads based on priority level. A priority level can be assigned to a newly created thread based on the default priority of the process owner, a priority stated explicitly in an OS command, or other methods. 9. Real-time scheduling requires the OS to know the maximum CPU time needed to complete one thread cycle and the frequency of cycles. Whenever it makes a scheduling decision, the scheduler must check the timer, CPU time used and time remaining before the deadline is reached, and maximum thread cycle time to ensure that the thread completes its cycle before the timer expires. This method can quickly consume available CPU resources. 10. Virtual memory management uses a portion of secondary storage to expand primary storage’s capacity. Programs and memory are divided into portions called pages, and each memory page is called a page frame. During program execution, one or more pages are allocated to page frames, and the rest are held in secondary storage. As pages in secondary storage are needed for current processing, the OS copies them into page frames. If necessary, pages currently in memory are written to secondary storage to make room for pages being loaded. Each memory reference is checked to see whether the page it refers to is currently in memory. A reference to a page held in memory is called a page hit, and a reference to a page held in secondary storage is called a page fault. The OS maintains page tables to store information about page locations, allocated page frames, status of pages, and secondary storage space. 11. Memory protection prevents memory allocated to one program from unauthorized access by another program. It can apply to interference between programs in a multitasking environment or interference between a program and the OS in a single-tasking or multitasking environment. If memory isn’t protected, errors in one program can generate errors in another. If the program being interfered with is the OS, the result might be a system crash.
Image of page 2
Image of page 3

{[ snackBarMessage ]}

Get FREE access by uploading your study materials

Upload your study materials now and get free access to over 25 million documents.

Upload now for FREE access Or pay now for instant access
Christopher Reinemann
"Before using Course Hero my grade was at 78%. By the end of the semester my grade was at 90%. I could not have done it without all the class material I found."
— Christopher R., University of Rhode Island '15, Course Hero Intern

Ask a question for free

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