CS540 Final

¡Supera tus tareas y exámenes ahora con Quizwiz!

throughput rate

# of processes that complete their execution per time unit

Physical Address Space (Size)

(# of frames × frame size) --> 2^x ex) Consider a logical address space of 256 pages with a 4-KB page size, mapped onto a physical memory of 64 frames. How many bits are required in the physical address? Let x be the number of physical addresses Physical address space (size) = 2^x Physical address space (size) = # of frames × frame size Physical address space (size) = 64 × 4 KB Physical address space (size) = 64 × 4096 Physical address space (size) = 2^6 × 2^12 = 2^18 x = 18

Logical Address Space (Size)

(# of pages × page size) --> 2^m ex) Consider a logical address space of 256 pages with a 4-KB page size How many bits are required in the logical address? Logical address space (size) = 2^m Logical address space (size) = # of pages × page size Logical address space (size) = 256 × 4 KB Logical address space (size) = 256 × 4096 Logical address space (size) = 1048576 Logical address space (size) = 2^20 m = 20 (Answer)

page fault

An event that occurs when an accessed page is not present in main memory. Page faults occur if a legal process address resides on a page not currently present in any physical frame in memory. The page then needs to be brought into memory (from disk).

Assuming a page size of 2K and a 32-bit machine, how many bits are used for the page number, and how many are used for the offset within the page? Give the main reason why page sizes are usually powers of two.

Answer: 21 bits for the page number, 11 bits for the offset within the page. page size = 2k = 2048 = 2^n = 2^11 n = 11 = offset page number = physical address - page size = 21 bits Three reasons for page sizes being powers of 2 (you needed two):1. It simplifies the design of hardware because translation of a logical address into a logical and then physical page number and page offset requires only masking off sections of an address represented as a binary number. So the hardware can mask and shift rather than having to add, subtract and divide.2. It makes the hardware both cheaper and faster.3. Page sizes should be multiples (usually 1) of disk block size, and they are usually powers of 2 as well.

Assuming a 1 KB page size, what are the page numbers and offsets for the following address references (provided as decimal numbers): a. 2375, b. 19366, c. 30000, d. 256, e. 16385

Answer: Since page size is 1 KB, we have 10 bits of offset. 1024 = 2^n n = 10 The remaining bits are the page numbers. So, a. 2375 = 0x947 = (1001 0100 0111)binary. Then, offset = lower 10 bits = (01 0100 0111) = 0x147 = 327 decimal. Page number = remaining high-order bits = (10) = 2 decimal So, results are: a. page = 2; offset = 327 b. page = 18; offset = 934 c. page = 29; offset = 304 d. page = 0; offset = 256 e. page = 16; offset = 1

C-LOOK scheduling ch9

Arm only goes as far as the last request in each direction, then reverses direction immediately, without first going all the way to the end of the disk.

Drive Connectivity ch9

Attached to computer's I/O bus (EIDE, ATA, SATA, USB). Host controller communicates with disk controller.

Preemptive Short-Term Scheduling

CPU scheduling decisions take place when a process: Switches from running to ready (preemptive) Switches from waiting to ready (preemptive) Examples of preemptive scheduling algorithms include Round Robin and Priority Scheduling with preemption.

Non-Preemptive Short-Term Scheduling

CPU scheduling decisions take place when a process: Switches from running to waiting (nonpreemptive) Terminates (nonpreemptive) Examples of non-preemptive scheduling algorithms include First-Come, First-Served (FCFS) and Shortest Job Next (SJN).

Page Replacement HW Q

Consider the following page reference string: 7, 2, 3, 1, 2, 5, 3, 4, 6, 7, 7, 1, 0, 5, 4, 6, 2, 3, 0 , 1. Assuming demand paging with three frames, how many page faults would occur for the following replacement algorithms? • LRU replacement • FIFO replacement • Optimal replacement

List at least three operations that may be performed on a file. ch10

Creating a file Reading from a file Writing to a file Deleting a file Truncating a file Appending to a file Renaming a file

Stable-Storage Implementation ch9

Disk write has 1 of 3 outcomes 1.Successful completion - The data were written correctly on disk 2.Partial failure - A failure occurred in the midst of transfer, so only some of the sectors were written with the new data, and the sector being written during the failure may have been corrupted 3.Total failure - The failure occurred before the disk write started, so the previous data values on the disk remain intact

Page Size/Frame Size

In paging, both pages and frames have the same size. It means that the blocks in the logical memory (pages) and physical memory (frames) are of equal size. 2^n where n = bits in offset ex) 1-KB page size 2^n = 1KB = 1024 = 2^10 of bits in offset part (n) =10 ex) 2-KB page size 2^n = 2KB = 2048 = 2^11 n = 11

Turn around time (TAT)

It defines the time difference between the completion time (CT) and the arrival time (AT). Turn Around Time (TAT) = Completion Time (CT) - Arrival Time (AT)

completion time

It defines the time when processes complete their execution.

Waiting Time

It defines the total time between requesting action and acquiring the resource. Waiting Time (WT) = Turn Around Time (TAT) - Burst Time (BT)

response time (RT)

It is the time that defines at which time the system response to a process.

Efficiency and Clusters ch9

Logical formatting: creating a file system. Efficiency improved by grouping blocks into clusters.

What are the advantages and disadvantages of : (a) Single-level directory, (b) Tree structured directory. ch10

(a) Single-level directory: Advantages: Simple and easy to implement. Every file has a unique name within the entire system. Disadvantages: Lack of organization and hierarchy, which can lead to naming conflicts and difficulties in managing a large number of files. (b) Tree structured directory: Advantages: Hierarchical organization provides better structure and easier navigation. Allows for grouping related files into directories. Disadvantages: May lead to longer path names, and navigating deep directory structures can become cumbersome.

Scheduling Algorithms

1. First-Come, First-Serve (FCFS) 2. Shortest-Job-First (SJF) 3. Shortest-Remaining-Time-First 4. Round Robin (RR)

File system

A method used by operating systems to store, retrieve, and organize files. resides on secondary storage(disk) Provides efficient and convenient access to disk by allowing data to be stored, located retrieved easily Disk provides in-place rewrite and random access

Optimal Page-Replacement algorithm (OPT)

A page replacement algorithm which has the lowest page fault rate and does not suffer from Belady's Anomaly. Replace the page that will not be used for the longest period of time. Use of this page-replacement algorithm guarantees the lowest possible page- fault rate for a fixed number of frames. uses the time when a page is to be used

Priority Scheduling

A priority is associated with each process, and the CPU is allocated to the process with the highest priority. (smallest integer = highest priority)

What is a raw partition? ch11

A raw partition refers to a section of a storage device that has not been formatted with a file system. It is essentially a block of storage without any organizational structure imposed by a file system. Raw partitions are often used for specific purposes, such as when setting up a new file system or when dealing with low-level disk operations.

Shortest Job First (SJF)

A scheduling algorithm that deals with each user or task based on the getting the smaller ones out of the way (nonpreemptive). Selects the process with the shortest total burst time first. The difficulty is knowing the length of the next CPU request

First-Come, First-Serve (FCFS)

A scheduling algorithm that deals with each user or task in the order in which they arrive, this can be thought of as a queue.

What is a volume? ch10

A volume is a single accessible storage area with a single file system, typically associated with a disk.

Access Latency and I/O Time ch9

Access latency = average seek time + average latency. Average I/O time = avg. access time + (transfer size / transfer rate) + controller overhead.

How do acyclic graph directory structure overcome the limitation of tree structured directory structure ? ch10

Acyclic graph directory structures overcome the limitation of tree-structured directory structures by allowing directories to have multiple parents, forming a more flexible and interconnected hierarchy. This prevents issues like overly deep or wide trees, and it allows for better organization and navigation.

Disk Organization ch9

Addressed as 1-dimensional arrays of logical blocks. Host-attached storage accessed through I/O ports.

page-replacement algorithm

Algorithm which decides which frames will be replaced when a page replacement occurs. FIFO OPT LRU

Shortest Remaining Time First

Shortest remaining time (SRTF) is a PREEMPTIVE version of SPN scheduling. A new process will cause the scheduler to interrupt the currently executing process if the CPU burst of the new process is less than the REMAINING SERVICE PERIOD of the current process. Then a context switch starting new process immediately. When no arrivals, scheduler selects process with the shortest CPU service period (burst). Considered multi-class since scheduler gives preference to processes with shortest remaining service time and processes with the shortest CPU burst.(As with SPN)

Could you simulate a multilevel directory structure with a single-level directory structure in which arbitrary long names can be used? How? Would your answer change if the file names were limited to seven characters? ch10

Simulating a multilevel directory structure with a single-level directory structure with arbitrary long names is possible using a naming convention. For example, you can use a delimiter (like '/') within the file names to represent different levels of directories. The answer may change if file names are limited to seven characters, as it would impose restrictions on representing the hierarchical structure within the names.

Explain soft and hard links, as used in Unix. ch10

Soft and hard links in Unix: Hard link: A reference to the same inode (data block) on the disk as the original file. Changes to one file affect all linked files because they point to the same data. Soft link (symbolic link): A separate file that contains a path reference to the original file. If the original file is deleted or moved, the symbolic link is left dangling. Soft links are more flexible but can cause issues if the original file is not available.

Tertiary Storage and Main Memory ch10

Tertiary storage uses removable media. Fixed disks generally more reliable than removable disks or tape drives. Main memory is more expensive than disk storage.

Discuss the differences between logical and physical addresses and address spaces as they relate to an executing program.

The MMU translates the logical address to physical address using the techniques of segmentation and/or paging.

The OS file system interface is said to provide an abstraction over reality. Explain. ch10

The OS file system interface provides an abstraction over reality by hiding the complexity of the underlying storage devices and their physical organization. It presents a simplified view of files and directories, allowing users and applications to interact with the system in a more user-friendly manner. Users don't need to be concerned with the details of how data is stored on disks or other storage media; they can work with files and directories in a higher-level, more intuitive way.

Scheduler

The component responsible for selecting the next process from the ready queue to run on the CPU is called the scheduler.

What is the most common way of structuring directories? ch10

The most common way of structuring directories is as a tree structure.

Paging

is a memory management scheme used in computer operating systems to manage and organize the transfer of data between the main memory (RAM) and secondary storage (usually a hard disk). It provides a way to virtualize the memory space seen by processes. physical memory and logical memory breaks into fixed-size blocks. These blocks are called "frames" in physical memory and "pages" in logical memory.

source file ch10

is a sequence of functions, each of which is further organized as declarations followed by executable statements.

executable file ch10

is a series of code sections that the loader can bring into memory and execute.

C-SCAN scheduling ch9

is a variant of SCAN designed to provide a more uniform wait time. Like SCAN, C-SCAN moves the head from one end of the disk to the other, servicing requests along the way. When the head reaches the other end, however, it immediately returns to the beginning of the disk without servicing any requests on the return trip SCAN and C-SCAN perform better for systems that place a heavy load on the disk, because they are less likely to cause a starvation problem.

CPU burst

the amount of time the process uses the processor before it is no longer ready Long bursts suggest processes that are more CPU-bound. CPU bursts are alternated with periods of waiting for I/O operations to complete.

Round Robin Scheduling

A PREEMPTIVE scheduling designed for Time Sharing Systems The Ready Queue is treated as a circular queue A small execution time interval is defined as the Time Quantum, or TIME SLICE Interrupts in Round Robin When the executing interval of a process reaches the time quantum, a SYSTEM TIMER will cause the OS to interrupt the process The OS carries out a CONTEXT SWITCH to the next selected process from the ready queue. Length of the Time Quantum Time quantum that is too short will generate many context switching and results in lower CPU efficiency. Time quantum too long may result in poor performance time.

Network File System (NFS) ch10

A Windows component that is a distributed file system used to manage shared files on a network.

file ch10

A collection of information saved as a unit. is an abstract data type a file is the smallest allotment of logical secondary storage; that is, data cannot be written to secondary storage unless they are within a file.

common file types ch10

A common technique for implementing file types is to include the type as part of the file name. The name is split into two parts—a name and an extension

Logically address

A logical address, also known as a virtual address, is an address generated by the CPU during program execution. It is the address seen by the process and is relative to the program's address space. The process accesses memory using logical addresses, which are translated by the operating system into physical addresses.

Disk Scheduling Algorithms ch9

FCFS: First come, first serve SSTF: shortest seek time first SCAN/Elevator: arm moves back and forth. CSCAN: arm immediately returns to the beginning. LOOK/CLOOK: arm reverses immediately at the last request.

information are associated with an open file ch10

File pointer. On systems that do not include a file offset as part of the read() and write() system calls, the system must track the last read- write location as a current-file-position pointer. This pointer is unique to each process operating on the file and therefore must be kept separate from the on-disk file attributes. • File-open count. As files are closed, the operating system must reuse its open-file table entries, or it could run out of space in the table. Multiple processes may have opened a file, and the system must wait for the last file to close before removing the open-file table entry. The file-open count tracks the number of opens and closes and reaches zero on the last close. The system can then remove the entry. •Disk location of the file. Most file operations require the system to modify data within the file. The information needed to locate the file on disk is kept in memory so that the system does not have to read it from disk for each operation. •Access rights. Each process opens a file in an access mode. This information is stored on the per-process table so the operating system can allow or deny subsequent I/O requests.

Explain in brief the file protection system in Linux. ch10

File protection system in Linux: Linux uses a permission system that assigns read, write, and execute permissions to three categories of users: owner, group, and others. These permissions can be set using the chmod command. Additionally, ownership of files and directories is assigned to specific users and groups.

File System Structure

File structure -Logical storage unit -Collection of related information

FCFS Scheduling ch9

First come, first served. Intrinsically fair but is not the fastest (moves back and forth) If the disk head is initially at cylinder 53, it will first move from 53 to 98, then to 183, 37, 122, 14, 124, 65, and finally to 67, for a total head movement of 640 cylinders.c

Table 9.1 is a page table for a system with 12-bit virtual and physical addresses with 256- byte pages. The list of free page frames is D, E, F (that is, D is at the head of the list, E is second, and F is last.)

Given the following virtual addresses, convert them to their equivalent physical addresses in hexadecimal. All numbers are given in hexadecimal. (A dash for a page frame indicates the page is not in memory.) (a) 9EF, (b) 111, (c) 700, (d) 0FF Answer: (a) 9EF - 0EF (b) 111 - 211 (c) 700 - D00 (d) 0FF - EFF

Hash table

Hash Table: Hash tables can be used to efficiently lookup and allocate tasks based on specific attributes or identifiers. This is useful when tasks have unique identifiers or attributes that aid in quick retrieval.

Heap

Heap: A heap data structure is valuable when tasks need to be allocated based on a specific criterion, such as the task with the minimum processing time. A min-heap or max-heap can be used based on the requirement.

Consider a file system where a file can be deleted and its disk space reclaimed while links to that file still exist. What problems may occur if a new file is created in the same storage area or with the same absolute path name? How can these problems be avoided? ch10

If a file system allows a file to be deleted while links to it still exist, creating a new file in the same storage area or with the same absolute path may lead to confusion or data integrity issues. To avoid problems, the file system could keep track of the number of links to a file and only reclaim disk space when the last link is deleted. Additionally, the system could prevent the creation of new files with the same absolute path until all links to the deleted file are removed. This approach ensures that no conflicting data exists in the storage area.

How do interrupts work for I/O systems? *Q from old final

In I/O systems, the CPU initiates an I/O operation, and when the device completes it, an interrupt is triggered. The CPU then pauses to execute the Interrupt Service Routine (ISR), which handles the completed I/O tasks. After that, the CPU restores its state and resumes the interrupted program.

What are the three general classifications of users in connection with each file? ch10

Owner or user Group Others (everyone else)

Physically address

Physical addresses are used by the memory management unit (MMU) to translate logical addresses into physical addresses.

Disk Formatting and Partitions ch9

Physical formatting: dividing disk into readable sectors. Partition: logical division of the disk into groups of cylinders.

Explain the difference between preemptive and nonpreemptive scheduling

Preemptive scheduling allows a process to be interrupted in the midst of its execution, taking the CPU away and allocating it to another process. Nonpreemptive scheduling ensures that a process relinquishes control of the CPU only when it finishes with its current CPU burst.

magnetic disks ch9

Primary secondary storage, rotating at 60 to 250 times per second. Transfer rate: rate of data flow between drive and computer. Positioning time includes seek time and rotational latency. Head crash: disk head making contact with disk surface.

Why is aging used during priority scheduling algorithms?

Priority scheduling algorithms can cause starvation for low-priority jobs (in cases when there is a steady stream of higher priority jobs entering the system). Aging will gradually raise the priority of older jobs over time, so they will eventually get a chance to run.

Queue

Queue: Queues are often used in task allocation when tasks need to be processed in a first-come-first-serve (FCFS) manner. New tasks are added to the end of the queue, and the task at the front is allocated next.

What is the fundamental reason RAID is used? ch9

RAID: multiple disks for reliability (striping, mirroring, parity). The fundamental reason RAID is used is for data redundancy and improved performance.

Consider the following page reference string: 1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6. How many page faults would occur for the following replacement algorithms, assuming one, two, three, four, five, six, or seven frames?

Remember all frames are initially empty, so your first unique pages will all cost one fault each.

Least Recently Used (LRU) Algorithm

Replace page that has not been used in the most amount of time We can think of this strategy as the optimal page-replacement algorithm looking backward in time, rather than forward.

FIFO Page Replacement

Replace the oldest page; simple to implement, but many page faults uses the time when a page was brought into memory

SSTF scheduling *i think important ch9

SSTF, or Shortest Seek Time First, is a disk scheduling algorithm used for the movement of the hard drive head in a computer storage system. SSTF is common and has a natural appeal because it increases performance over FCFS selects the request with the least seek time from the current head position. In other words, SSTF chooses the pending request closest to the current head position. For our example request queue, the closest request to the initial head position (53) is at cylinder 65. Once we are at cylinder 65, the next closest request is at cylinder 67. From there, the request at cylinder 37 is closer than the one at 98, so 37 is served next. Continuing, we service the request at cylinder 14, then 98, 122, 124, and finally 183 (Figure 9.5). This scheduling method results in a total head movement of only 236 cylinders

What are the two fundamental ways of accessing a file? ch10

Sequential access Direct access (Random access)

Internal Fragmentation

occurs when memory is allocated in fixed-size blocks, and the allocated memory is larger than what the process actually needs. wasted space within allocated memory blocks.

How to find number of frames

The size of the physical address space is equal to the number of frames multiplied by the frame size. Number of frames = physical address space / frame size

page table

The table containing the virtual to physical address translations in a virtual memory system. The table, which is stored in memory, is typically indexed by the virtual page number; each entry in the table contains the physical page number for that virtual page if the page is currently in memory.

What are the three possible outcomes when writing to disk? ch10

The write is successful. The write fails, indicating a fatal error. The write is partially successful, resulting in a write with errors.

Tree

Tree: Trees, such as binary trees or n-ary trees, can be utilized to represent hierarchical relationships among tasks. This is beneficial when tasks have parent-child relationships, and allocation needs to follow a hierarchical structure.

address translation (address mapping)

When a process generates a logical address, it is divided into two parts: the page number (high-order bits) and the offset within the page (low-order bits). The page number is used as an index in the page table to find the corresponding frame number in physical memory. ex) Assuming a 1-KB page size, what are the page numbers and offsets for the following address references (provided as decimal numbers): a) 3085 Convert logical address: Decimal to Binary Split binary address to 2 parts (page #, Offset) Convert offset & page #: Binary to Decimal Decimal = 3085 Binary = 000000110000001101 Page # = 011 = 3 P age offset = 0000001101 = 13

Andrew File System (AFS) ch10

Writes only visible to sessions started after the file is closed. Once a file is closed, changes are visible only in later sessions

schedule following processes using Round-Robin algorithm

You need to show: - both scheduling queue and timeline. - finished time for each process. q=3 Answer: Ready queue: P1, P3, P1, P2, P4, P3, P5, P1, P3, P5 Completion time for process P1 = 22, P2 = 11, P3 = 23, P4 = 14 and P5 = 25.

text file ch10

a file that holds text without any formatting and can be opened in numerous applications

The page table shown is for a system with 16-bit virtual and physical addresses and with 4,096-byte pages. The reference bit is set to 1 when the page has been referenced. Periodically, a thread zeroes out all values of the reference bit. A dash for a page frame indicates the page is not in memory. The page-replacement algorithm is localized LRU, and all numbers are provided in decimal.

a)Convert the following virtual addresses (in hexadecimal) to the equivalent physical addresses. here total bit for virtual address = 16 bit size of page = 4k = 2^12 = 12 bit hence offset = 12bit bit for no. of pages = 16-12 = 4 bit = 2^4 pages = 16 pages So, the first 4 bits from left of the virtual address represents page number and the 12 bits from the right represents the offset of page size. 0xE12C - 0x312C for E12C = hence page number = E = 14 and offset = 12C for page number 14 frame number = 3 from table. hence frame number in hexadecimal = 3 • 0x3A9D - 0xAA9D for 3A9D = hence page number = 3 in hex = 3 in dec and offset = A9D for page number 3 frame number = 10 from table. hence frame number in hexadecimal = A (10 in dec) • 0xA9D9 - 0x59D9 for A9D9 = hence page number = A = 10 and offset = 9D9 for page number 10 frame number = 5 from table. hence frame number in hexadecimal = 5 • 0x7001 - 0xF001 for 7001 = hence page number = 7 = 7 and offset = 001 for page number 7 frame number = 15 from table. hence frame number in hexadecimal = F • 0xACA1 - 0x5CA1 for ACA1 = hence page number = A = 10 and offset = CA1 for page number 10 frame number = 5 from table. hence frame number in hexadecimal = 5 b)Using the above addresses as a guide, provide an example of a logical address (in hexadecimal) that results in a page fault. page 4,8,12, or 13 will result in a page fault since there are no frames for those pages Therefore an example of a logical address that will result in a page fault would be: 0xC12C since the decimal of C is 12 and there is no frame for page 12 c)From what set of page frames will the LRU page-replacement algorithm choose in resolving a page fault? Any page table entries that have a reference bit of zero. This includes the following frames {9, 1, 14, 13, 8, 0 ,4}

Consider the following segment table: What Segment Base are the physical addresses for the following logical addresses?

a. 0, 430 b. 1, 10 c. 2, 500 d. 3, 400 e. 4, 112 Answer: *length has to be greater than base a. 219 + 430 = 649 b. 2300 + 10 = 2310 c. illegal reference, trap to operating system --> 100>500? no , its illegal d. 1327 + 400 = 1727 e. illegal reference, trap to operating system --> is 96>112? no, its illegal

Assuming a 1-KB page size, what are the page numbers and offsets for the following address references (provided as decimal numbers)

a. 3085 110000001101 page number:11 page offset:0000001101 thus page number = 3 and page offset = 13 b. 42095 101001 0001101111 Page number = 41 Page offset = 219 c. 215201 Page number = 210 Page Offset = 161 d. 650000 Page number = 634 Page Offset = 784 e. 2000001 Page number = 1953 Page Offset = 129

Solaris ZFS ch10

adds checksums of all data and metadata detect if object is the right one and whether it changed

storage networks ch9

connect multiple storage devices on a separate high-speed network dedicated to storage SAN: many hosts connect to many storage units. NAS: storage accessible over a network.

Swap space management ch9

disk space extension of main memory

Use page/frame table to translate logical addresses into physical address. Mark page fault if needed

ex)assuming a 2KB page size: Provide page numbers and offset for following addresses (in decimal). Use page/frame table to translate logical addresses into physical address. Mark page fault if needed. To translate a logical address to the corresponding physical address, we divide the logical address into page number and offer, we use the page number as index to the page table and the entry gives the corresponding frame number. We concatenate frame number with the offset, which gives us the corresponding physical address. Address 1: 3686 Page number = 1 Offset within the page = 1638 Translate using page table: Frame's base address for page 1 is 1000 Physical address = 1000 + 1638 = 2638 Result: Page 1, Offset 1638 → Frame 1000, Offset 1638 → Physical Address 2638 Address 2: 42095 Page number = 20 Offset within the page = 1135 physical address = 106135 Address 3: 2000001 Page number = 976 Offset within the page = 641 Page fault! Page 976 is not in the page table. Address 4: 215201 Page number = 105 Offset within the page = 161 Physical address = 305000 + 161 = 305161 Address 5: 650001 Page number = 317 Offset within the page = 785 Page fault!

Belady's Anomaly

for some page replacement algorithms, the page-fault rate may increase as the number of allocated frames increases only fifo suffers from this

External Fragmentation

is the presence of scattered, non-contiguous free memory blocks.

CPU utilization

keep the CPU as busy as possible

How to find number of pages

number of pages = logical address space/page size or calculated as 2^(m-n)

data structure in task allocation ch11

queue priority queue stack linked list hash table heap tree array

Short-term scheduler

selects from among the processes in ready queue, and allocates the CPU to one of them CPU scheduling decisions take place when a process: Switches from running to waiting (nonpreemptive) Switches from running to ready state (preemptive) Switches from waiting to ready (preemptive) Terminates (nonpreemptive)

Long-term scheduler

selects which processes should be brought into the ready queue

SCAN algorithm ch9 maybe this one also

the disk arm starts at one end of the disk and moves toward the other end, servicing requests as it reaches each cylinder, until it gets to the other end of the disk. At the other end, the direction of head movement is reversed, and servicing continues. The head continuously scans back and forth across the disk. ***The SCAN algorithm is sometimes called the elevator algorithm***, since the disk arm behaves just like an elevator in a building, first servicing all the requests going up and then reversing to service requests the other way. Before applying SCAN to schedule the requests on cylinders 98, 183, 37, 122, 14, 124, 65, and 67, we need to know the direction of head movement in addition to the head's current position. Assuming that the disk arm is moving toward 0 and that the initial head position is again 53, the head will next service 37 and then 14. At cylinder 0, the arm will reverse and will move toward the other end of the disk, servicing the requests at 65, 67, 98, 122, 124, and 183 (Figure 9.6). If a request arrives in the queue just in front of the head, it will be serviced almost immediately; a request arriving just behind the head will have to wait until the arm moves to the end of the disk, reverses direction, and comes back.

I/O burst

where the process waits for input/output operations to complete. Short bursts indicate processes that are more I/O-bound.

Round robin HW

write queue and timeline

List at least three attributes of a file. ch10

• Name. The symbolic file name is the only information kept in human- readable form. •Identifier.This unique tag, usually a number, identifies the file within the file system; it is the non-human-readable name for the file. • Type. This information is needed for systems that support different types of files. • Location. This information is a pointer to a device and to the location of the file on that device. • Size. The current size of the file (in bytes, words, or blocks) and possibly the maximum allowed size are included in this attribute. • Protection. Access-control information determines who can do reading, writing, executing, and so on. • Time, date, and user identification. This information may be kept for creation, last modification, and last use. These data can be useful for protection, security, and usage monitoring.


Conjuntos de estudio relacionados

5.1 Connecting Citizens with Government

View Set

Neutropenic isolation guidelines

View Set

Chapter 17 The Cardiovascular System I: The Heart

View Set

Roots, Stems, and Leaves: Section 4

View Set