Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 1 out of 4 pages
Exam (elaborations)

CSCI 114 Final Exam Questions With Detailed Correct Answers Graded A+

Document preview thumbnail
Preview 1 out of 4 pages

(1) Please complete the following function for readShouldWait(). bool RWLock::readShouldWait() { return ( activeWriters0 || _________________ ); - correct answers waitingWriters 0 (2) Please complete the following function for startWrite(). bool RWLock:: startWrite() { re(); ___________________++; while(___________________) { ___________________.wait(&lock) } activeWriters++; se(); } - correct answers waitingWriters writeShouldWait() writeGo waitingWriters--; (3) Please complete the following function for doneRead(). bool RWLock:: doneRead() { re(); _________________; if( _________________ && waitingWriters0) writeGl(&lock); se(); } - correct answers activeReaders-- activeReaders == 0 As we know, FFS includes in each inode 12 direct, 1 indirect, 1 double indirect, 1 triple indirect, and 1 quadruple indirect pointer. File blocks are of size of 4KB and pointers are of size of 4 Bytes. For the following blanks, use units such as K,M,G,T,P for bytes. For example, 5GB, 10TB, etc. Each direct pointer can support up to ___________ size of files. Each indirect pointer can support up to ___________ size of files. Each double indirect pointer can support up to ___________ size of files. Each triple indirect pointer can support up to ___________ size of files. Each quadruple indirect pointer can support up to ___________ size of files. - correct answers 4 KB 4 MB 4 GB 4 TB 4 PB As we know, FFS includes in each inode 12 direct, 1 indirect, 1 double indirect, 1 triple indirect, and 1 quadruple indirect pointer. File blocks are of size of 4KB and pointers are of size of 8 Bytes. For the following blanks, use units such as K,M,G,T,P for bytes. For example, 5GB, 10TB, etc. Each direct pointer can support up to ___________ size of files. Each indirect pointer can support up to ___________ size of files. Each double indirect pointer can support up to ___________ size of files. Each triple indirect pointer can support up to ___________ size of files. Each quadruple indirect pointer can support up to ___________ size of files. - correct answers 4 KB 2 MB 1 GB 0.5 TB 0.25 PB SHORTEST SEEK TIME FIRST is 75, - correct answers 66, 87, 93, 36, 23 WITH SCAN, the sequence is 75, - correct answers 87, 93,66,36,23 WITH C-SCAN, the sequence is 75, - correct answers 87,93,23,36,66 Assuming there is no overhead for context switch. Please identify that which task (A or B) is scheduled during each of the 1ms time slots as follows: . "A" means only A is scheduled in CPU and B is not scheduled and not doing IO . "B" means only B is scheduled in CPU . "A-IOB" means A is scheduled while 1/O for B. . "IOB" means just B doing I/O during the time slot. . "NONE" means neither A nor B is scheduled or doing IO during the time slot. - correct answers A (20 times) B (2 times) IOB (8 times) B (2 times) IOB (8 times) A, B, A, B A-IOB (8 times) B, A, B A-IOB (8 times) A ( 1 time) NONE (17 times) A ( 21 times) B (2 times) IOB (8 times) B (2 times) IOB (7 times) Banker's Algorithm Question - correct answers 5, 3, 2, 1, 1, 1, 2, 1, p2, 2, 2, 1, p0 Suppose R=3,2,4,3,4,2,2,3,4,5,6,7,7,6,5,4,5,6,7,2 is a page reference stream. - correct answers row 1 = [3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5] row2 = [3, NONE, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 6, 6, 6, 6] row3 = [NONE, NONE, 4, 4, 4, 4, 4, 4, 4, 4, 7, 7, 7, 7, 4, 4]

Content preview

CSCI 114 Final Exam Questions With
Detailed Correct Answers Graded A+

(1) Please complete the following function for readShouldWait(). bool RWLock::readShouldWait() {

return ( activeWriters>0 || _________________ ); - correct answers waitingWriters > 0



(2) Please complete the following function for startWrite().

bool RWLock:: startWrite() {

lock.acquire();

___________________++;

while(___________________) {

___________________.wait(&lock)

}

activeWriters++;

lock.release();

} - correct answers waitingWriters

writeShouldWait()

writeGo

waitingWriters--;



(3) Please complete the following function for doneRead(). bool RWLock:: doneRead() {

lock.acquire();

_________________;

if( _________________ && waitingWriters>0) writeGo.signal(&lock); lock.release(); } - correct answers
activeReaders--

activeReaders == 0

Document information

Uploaded on
April 21, 2026
Number of pages
4
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$15.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
RealGrades
4.0
(26)
Sold
197
Followers
52
Items
12331
Last sold
3 weeks ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions