Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 2606 Project 2 Clarifications

Similar presentations


Presentation on theme: "CS 2606 Project 2 Clarifications"— Presentation transcript:

1 CS 2606 Project 2 Clarifications

2 Clarifications Output specs Write-through versus write-back buffers
The remove operation and the buffer pool Note: all of these clarifications are consistent with the project specs and the sample files posted

3 Output specs insert command print command remove command
insert #: record length = # + # = #, stored at position # print command print # <record contents> remove command remove #: at position #, record length = # Note: if the insert command involves a remove, only the insert operation produces output

4 Output specs buffers command freelist command Notes:
buffers: b1 b2 b3 … freelist command freelist: p1 s1, p2 s2, p3 s3, … Notes: buffer indices and free list positions begin at 0 buffer list starts with LRU block, ends with MRU block free list is sorted by position

5 Write-through vs Write-back buffers
Write-through buffers: insert command always results in a physical disk write Write-back buffers: physical disk write occurs only when necessary during a page fault (disk writes are minimized) Write-through buffers are easier to implement, you get extra-credit (5%) if you implement a write-back buffer In both cases, the insert command affects the buffer pool (blocks involved in the operation become the most recently used blocks)

6 Example Suppose size of buffer pool = 2, and all records are 200 bytes each Consider the sequence: command write-through write-back insert 1 write fblock 1 insert 2 write fblock 1 insert 3 write fblocks 1,2 print 1 print 2 print 3 insert 4 write fblock 2 insert 5 write fblock 2 insert 6 write fblocks 2,3 write fblock 1 no disk operations

7 Example, continued After the last command, buffer pool contains fblocks 2, 3 If we continue with the following operations: command write-through write-back insert 6 write fblocks 2,3 write fblock 1 print 1 fblk 1 in, fblk 2 out fblk 1 in, write fblk 2 print 2 print 3 fblk 2 in, fblk 3 out fblk 2 in, write fblk 3 print 4 print 5 print 6 fblk 3 in, fblk 1 out fblk 3 in, no write * * write not necessary because block 1 not dirty

8 The remove operation Question: does the remove operation require a buffer pool update or a disk operation? Maybe, depending on how complex we want this project to be For simplicity, you may assume that remove is strictly a memory manager operation (refer to the previous slide set about this project); no buffer pool update will result from a remove Important: you need to deal with obtaining the size of the removed record (keep a table, or retrieve the 4 bytes from the file, without using the buffer pool)


Download ppt "CS 2606 Project 2 Clarifications"

Similar presentations


Ads by Google