Dashboard My courses COMP9283-COMP3231-COMP3891-COMP9201-5203_00462 General Sample Final Exam V2
Information
Question 1
Not answered
Marked out of
Question 2
Not answered
Marked out of
Question 3
Not answered
Marked out of
Question 4
Not answered
Marked out of
Started on Monday, 11 May 2020, 5�08 PM
State Finished
Completed on Monday, 11 May 2020, 5�08 PM
Time taken 11 secs
Grade 0.00 out of 86.00 (0%)
(Staff Only)
Site Home
Announcements
User Guides
For each question in this section, classify the overall statement as �ẃẴǴ if the statement is generally true, or à ǀ ḵẎǴ if the statement (or
a component of it) is false.
You will receive one mark for each correct classification, and lose one mark for each incorrect
classification. You gain zero marks for each question left unclassified.
ì ṙ ḵǨ ǀ ṎǨ ỹ ǀ ḙẤ is a practical deadlock prevention strategy.
Select one:
The correct answer is: False
Semaphores can be used to implement mutually exclusive execution in ǜẃḙẤḙǜǀ ḵ ẎǴǜẤḙṙ ṎẎ in a multi-threaded program by initialising the
semaphore count to zero.
Select one:
The correct answer is: False
On a uniprocessor machine, disabling interrupts prior to entering short critical sections, and re-enabling interrupts on exiting is a
reasonable approach to achieving mutual exclusion within critical sections inside the operating system.
Select one:
The correct answer is: True
An operating system implements deadlock detection. Upon detecting deadlock, it notifies the system administrator of the set of
deadlocked processes that it has detected. A practical method of deadlock recovery is for the administrator to kill one of the
processes in the set, thus allowing the others to continue.
Select one:
The correct answer is: True
COMP3231/COMP9201/COMP3891/COMP9283 Operating Systems T1-2020 Kah May Tan
Dashboard
Profile
Messages
Preferences
Privacy Settings
Log out
https://moodle.telt.unsw.edu.au/my/
https://moodle.telt.unsw.edu.au/course/view.php?id=48561
https://moodle.telt.unsw.edu.au/mod/quiz/view.php?id=2957991
http://www.unsw.edu.au/
http://bit.ly/2vxLDNi
http://bit.ly/2vxLDNi
http://bit.ly/2CsKery
http://bit.ly/2CsKery
http://bit.ly/2FECVjK
http://bit.ly/2FECVjK
https://moodle.telt.unsw.edu.au/?redirect=0
http://moodle.telt.unsw.edu.au/mod/page/view.php?id=41448
https://student.unsw.edu.au/moodle/support
https://moodle.telt.unsw.edu.au/my/
https://moodle.telt.unsw.edu.au/user/profile.php?id=2231393
https://moodle.telt.unsw.edu.au/grade/report/overview/index.php
https://moodle.telt.unsw.edu.au/message/index.php
https://moodle.telt.unsw.edu.au/user/preferences.php
https://moodle.telt.unsw.edu.au/local/userpolicy/index.php
https://moodle.telt.unsw.edu.au/login/logout.php?sesskey=wdLITkqk5k
Question 5
Not answered
Marked out of
Question 6
Not answered
Marked out of
Question 7
Not answered
Marked out of
Question 8
Not answered
Marked out of
Condition variables are used to manage blocking and waking within critical sections protected by semaphores.
Select one:
The correct answer is: False
Deadlock ṿẃǴỴǴṎẤḙṙ Ṏ can be achieved by mitigating one of the four conditions required for deadlock. Each one of the four conditions
are as practical a candidate to mitigate as any of the others.
Select one:
The correct answer is: False
The following synchronised code ( ḙṎǜᾨᾩ ) is deadlock free when called by multiple threads concurrently. Note: ḙṎǜᾨᾩ is the only
function that acquires ǜṙ ẴṎẤ�ḵṙ ǜḮ .
int count;
void inc()
lock_acquire(count_lock);
count = count + 1;
lock_release(count_lock);
Select one:
The correct answer is: True
A hypothetical i-node-based file system consists of i-nodes with only 12 direct addresses of blocks, and no addresses of indirect
blocks. Each direct address is a 32-bit integer, and the block size is 2KiB. This file system only supports files with a maximum size of
Select one:
The correct answer is: True
Question 9
Not answered
Marked out of
Question 10
Not answered
Marked out of
Question 11
Not answered
Marked out of
Question 12
Not answered
Marked out of
Question 13
Not answered
Marked out of
A buffer cache improves performance by buffering writes to disk, allowing the application to continue computation while buffers are
written back to the disk in the background. This increases the chance of losing data during a power failure.
Select one:
The correct answer is: True
File systems based on indexed allocation (i.e. i-node-based file systems) have good random access performance.
Select one:
The correct answer is: True
A FAT file system gets its name as it is designed for really big disks.
Select one:
The correct answer is: False
Adding journaling to a file system (co-located on the same device) improves reliability without changing the number of writes to the
Select one:
The correct answer is: False
Using a bitmap to manage free blocks on a disk reduces the usable disk capacity compared to the approach of storing the addresses
of free blocks in the free blocks themselves.
Select one:
The correct answer is: True
Question 14
Not answered
Marked out of
Question 15
Not answered
Marked out of
Question 16
Not answered
Marked out of
Question 17
Not answered
Marked out of
Question 18
Not answered
Marked out of
A file system using linked-list disk allocation (also termed chained allocation) provides poor random access performance.
Select one:
The correct answer is: True
Using an operating system is always more efficient than programming the computer hardware directly, even for a single simple
application.
Select one:
The correct answer is: False
An operating system is not responsible for arbitrating between processes competing for system resources.
Select one:
The correct answer is: False
In the ẴẎǴẃ Ṋ ṙ ǨǴ of the microprocessor, only the application’s virtual memory is accessible to the processor.
Select one:
The correct answer is: True
Compared to ṿṙ ḵḵǴǨ I/O, ḙṎẤǴẃẃẴṿẤᾷǨẃḙỴǴṎ I/O is preferable when there is a significant delay between requesting something from a
device and the device providing the response.
Select one:
The correct answer is: True
Question 19
Not answered
Marked out of
Question 20
Not answered
Marked out of
Question 21
Not answered
Marked out of
Question 22
Not answered
Marked out of
Question 23
Not answered
Marked out of
A ẃǴǀ Ǩ ǘǴḂṙ ẃǴ ẤǴẎẤ ǀ ṎǨ ẎǴẤ implementation of a spinlock (also called a ẤǴẎẤ ǀ ṎǨ ẤǴẎẤ ǀ ṎǨ ẎǴẤ) just adds extra overhead to the lock
implementation by adding a superfluous read.
Select one:
The correct answer is: False
On a uniprocessor machine, it is more efficient to ǘḵṙ ǜḮ and context switch than to spin (busy-wait) on a lock, even if the context
switching overhead is very high.
Select one:
The correct answer is: True
A context switch between user-level threads (also termed a thread switch), can be implemented by an assembly language function
called from Q that pushes a subset of the registers onto the current stack, saves the current stack pointer, and then sets the stack
pointer to the target thread, and restores the target’s registers.
Select one:
The correct answer is: True
In the three-state process model, a common state transition is from the ẃǴǀ Ǩӑ state to the ǘḵṙ ǜḮ ǴǨ state.
Select one:
The correct answer is: False
Multi-tasking can improve system utilisation for I/O-bound workloads by overlapping I/O with execution of other ẃǴǀ Ǩӑ applications.
Select one:
The correct answer is: True
Question 24
Not answered
Marked out of
Question 25
Not answered
Marked out of
Question 26
Not answered
Marked out of
Question 27
Not answered
Marked out of
Question 28
Not answered
Marked out of
Co-operative (non-preemptive) multitasking can result in a non-responsive system if an application has an endless loop.
Select one:
The correct answer is: True
Applications can benefit from running on multi-processors when they are implemented to use multi-threading provided by kernel-
level threads, but not user-level threads.
Select one:
The correct answer is: True
Application multi-threading supported by user-level threads features a per-thread user-level stack and a 1-to-1 corresponding per-
thread in-kernel stack.
Select one:
The correct answer is: False
The traditional UNIX scheduler uses priorities to favour I/O-bound processes over CPU-bound processes. It fails to adjust when
CPU-bound processes become I/O-bound and vice versa.
Select one:
The correct answer is: False
General purpose schedulers aim to improve interactivity and I/O performance by favouring I/O-bound processes (and threads) over
CPU-bound processes (and threads). This improvement for I/O-bound processes comes with the disadvantage of dramatically
reducing the CPU available to CPU-bound processes (and threads).
Select one:
The correct answer is: False
Question 29
Not answered
Marked out of
Question 30
Not answered
Marked out of
Question 31
Not answered
Marked out of
Question 32
Not answered
Marked out of
A system call ṿẃṙ ǜǴẎẎṙ ẃ ḙṎẎẤẃẴǜẤḙṙ Ṏ is one way to trigger the transition between the application running in user-mode to the
Operating System running in privileged mode.
Select one:
The correct answer is: True
The following program uses the Ḃṙ ẃḮ ᾨᾩ system call to create new processors. Running the program results in “Hello World” being
printed 3 times.
printf(“Hello World\n”);
Select one:
The correct answer is: False
Because the operating system runs in privileged mode, the operating system can safely use the memory pointers provided by
applications (via the arguments to system calls) just like in-kernel memory pointers.
Select one:
The correct answer is: False
A computer has a 32-bit virtual address space and uses a two-level page table. The top-level of the page table has 256 entries, and
the second-level page tables have 1024 entries. That implies the page size on the computer must be 16 KiB.
Select one:
The correct answer is: True
Question 33
Not answered
Marked out of
Question 34
Not answered
Marked out of
Question 35
Not answered
Marked out of
Question 36
Not answered
Marked out of
Question 37
Not answered
Marked out of
The size of an ḙṎỴǴẃẤǴǨ ṿǀ ḅǴ Ấǀ ǘḵǴ is determined by the virtual address space size of a process, and is unrelated to the size of
physical memory.
Select one:
The correct answer is: False
Ďỹ ǀ ṿṿḙṎḅ allows an application larger than physical memory to execute.
Select one:
The correct answer is: False
An ḙṎỴǴẃẤǴǨ ṿǀ ḅǴ Ấǀ ǘḵǴ is a single data structure shared between all processes, therefore, it is efficient at enabling the sharing of
virtual memory between multiple processes.
Select one:
The correct answer is: False
È ṿẤḙṊ ǀ ḵ is the best practical page replacement algorithm.
Select one:
The correct answer is: False
A Ḃẃǀ Ṋ Ǵ Ấǀ ǘḵǴ is not required to manage free frames when using an ḙṎỴǴẃẤǴǨ ṿǀ ḅǴ Ấǀ ǘḵǴ as virtual address translation and free frame
management is combined into the one data structure.
Select one:
The correct answer is: True
Question 38
Not answered
Marked out of
Question 39
Not answered
Marked out of
Question 40
Not answered
Marked out of
Question 41
Not answered
Marked out of
Information
When choosing a victim for page replacement, a ǜḵǴǀ Ṏ page is faster to replace than a ǨḙẃẤӑ page.
Select one:
The correct answer is: True
In a system using page-based virtual memory, increasing the page size will generally decrease the working set size of an existing
application.
Select one:
The correct answer is: False
In a system using page-based virtual memory, increasing the page size will generally increase the TLB miss rate.
Select one:
The correct answer is: False
In this section you will match pairs that are the most closely related. Each correct pair earns of the marks available for the
question, where is the number of pairs to match.
ZǴǀ Ǩḵṙ ǜḮ ṿẃǴỴǴṎẤḙṙ Ṏ is a strategy where one of the four conditions required for deadlock is prevented, thereby preventing deadlock
from occurring.
Listed below are the four conditions required for deadlock and four approaches to preventing the condition from occurring. Match
the individual condition with its method of prevention.
Mutual exclusion Choose…
Hold and Wait Choose…
Circular Wait Choose…
No Preemption Choose…
The correct answer is: Mutual exclusion → Always infeasible, Hold and Wait → Allocate all required resources initially, Circular Wait →
Use a single defined order of resource acquistion, No Preemption → Nearly always impractical to remove a resource
Question 42
Not answered
Marked out of
Question 43
Not answered
Marked out of
Question 44
Not answered
Marked out of
Given the statements below, match them to whether they describe internal, external, or not fragmentation.
Space wasted due to space needed being smaller than space allocated. Choose…
Space wasted due to space needed being larger than space available between existing allocations. Choose…
The correct answer is: Space wasted due to space needed being smaller than space allocated. → Internal fragmentation, Space
wasted due to space needed being larger than space available between existing allocations. → External fragmentation
For each resource, OS or processor feature listed below, indicate whether it is accessible in kernel (privileged) mode, user mode, or
in both modes.
The application’s page table Choose…
The application’s memory containing the ẎẤǀ ṎǨǀ ẃǨ Q ḵḙǘẃǀ ẃӑ Choose…
A TLB management instruction Choose…
Application memory Choose…
An interrupt disabling instruction Choose…
The registers used to transfer system call arguments. Choose…
Hard disk drive controller registers Choose…
An add instruction Choose…
The correct answer is: The application’s page table → Kernel mode, The application’s memory containing the ẎẤǀ ṎǨǀ ẃǨ Q ḵḙǘẃǀ ẃӑ →
Kernel mode and user mode, A TLB management instruction → Kernel mode, Application memory → Kernel mode and user mode, An
interrupt disabling instruction → Kernel mode, The registers used to transfer system call arguments. → Kernel mode and user mode,
Hard disk drive controller registers → Kernel mode, An add instruction → Kernel mode and user mode
In a system that supports multi-threaded processes, for each attribute listed below, indicate whether it is a per process or a per
thread attribute.
Global variables Choose…
The execution state, e.g. blocked, ready, running Choose…
Open file descriptors Choose…
General purpose registers Choose…
Program counter Choose…
Virtual address space Choose…
Stack Choose…
Local variables Choose…
The correct answer is: Global variables → Per process, The execution state, e.g. blocked, ready, running → Per thread, Open file
descriptors → Per process, General purpose registers → Per thread, Program counter → Per thread, Virtual address space → Per
process, Stack → Per thread, Local variables → Per thread
Information
Question 45
Not answered
Marked out of
This section consists of choosing the most correct answer from the multiple choices available.
A correct answer earns 100% of the marks available. An incorrect answer subtracts of the marks available, where is the
number of choices available in the question.
For example, an incorrect answer to a questions with 5 choices would reduce your marks by of the marks available for the
specific question.
No marks are awarded or subtracted for unanswered questions.
Bill and Ben are two threads that execute the functions of the same name below respectively. Bill and Ben are prone to deadlock.
Identify the function calls in Bill and Ben where they end up deadlocked if they deadlock.
Each line of code in each function has a line number to help you identify the location of deadlock.
void bill()
1: lock_acq(&file2)
2: lock_acq(&file3)
3: lock_acq(&file1)
/* access all three files mutually exclusively */
4: lock_rel(&file3)
5: lock_rel(&file1)
/* do nothing */
6: lock_acq(&file1)
/* access file1 and file2 mutually exclusively */
7: lock_rel(&file1)
8: lock_rel(&file2)
void ben()
1: lock_acq(&file2)
2: lock_acq(&file3)
3: lock_acq(&file1)
/* access all three files mutually exclusively */
4: lock_rel(&file3)
5: lock_rel(&file2)
/* do nothing */
6: lock_acq(&file3)
/* write to file1 and file3 */
7: lock_rel(&file1)
8: lock_rel(&file3)
Select one:
Bill line 6, Ben line 6
Bill line 6, Ben line 3
Bill line 4, Ben line 7
Bill line 3, Ben line 6
The correct answer is: Bill line 3, Ben line 6
Question 46
Not answered
Marked out of
In most UNIX file systems, every file has an index block, called an ḙᾷṎṙ ǨǴ, which is used to store
information about the file as well as pointers to data blocks, as shown in the diagram below.
Assume a block size of 2 KiB (2048 bytes) and 4-byte block numbers. What is the approximate largest possible file size supported
by this filesystem?
Select one:
274877906944 bytes
275415851008 bytes
8.796 * 10^12 bytes
24576 bytes
1048576 bytes
536870912 bytes
The correct answer is: 275415851008 bytes
Question 47
Not answered
Marked out of
Below is a (somewhat compressed and simplified) snapshot of a TLB with 20 entries.
All mappings use 4 KiB page sizes. “VPN” is the virtual page number, “PFN” is the physical frame
number, “V” indicates if the entry is valid (1) or not (0), and “D” (Dirty) indicates if a valid entry
is writable (1) or not (0). All numbers are hexadecimal.
200 31a 0 1
7fffe 54 1 1
7fffd 56 0 0
7ffff 50 1 1
201 6d 1 1
203 aa 0 1
202 4f 1 1
7fffc 97 1 1
If software attempts to access virtual address 0x7fffe18d, choose the most accurate answer from the options below.
Select one:
Physical address 0x54 is accessed
Physical address 0x54 is accessed, and stores are allowed.
Physical address 0x5418d is accessed, stores are not allowed.
A TLB exception occurs.
Physical address 0x5418d is accessed, and stores are allowed.
The correct answer is: Physical address 0x5418d is accessed, and stores are allowed.
Question 48
Not answered
Marked out of
Below is a (somewhat compressed and simplified) snapshot of a TLB with 20 entries.
All mappings use 4 KiB page sizes. “VPN” is the virtual page number, “PFN” is the physical frame
number, “V” indicates if the entry is valid (1) or not (0), and “D” (Dirty) indicates if a valid entry
is writable (1) or not (0). All numbers are hexadecimal.
200 31a 0 1
7fffe 54 1 1
7fffd 56 0 0
7ffff 50 1 1
201 6d 1 1
203 aa 0 1
202 4f 1 1
7fffc 97 1 1
If software attempts to access virtual address 0x00009dde, choose the most accurate answer from the options below.
Select one:
A TLB exception occurs.
Physical address 0x7adde is accessed, and stores are allowed.
Physical address 0x7adde is invalid, but stores are allowed.
Physical address 0x7a is invalid but stores are allowed.
Physical address 0x7a is accessed
The correct answer is: A TLB exception occurs.
Question 49
Not answered
Marked out of
Below is a (somewhat compressed and simplified) snapshot of a TLB with 20 entries.
All mappings use 4 KiB page sizes. “VPN” is the virtual page number, “PFN” is the physical frame
number, “V” indicates if the entry is valid (1) or not (0), and “D” (Dirty) indicates if a valid entry
is writable (1) or not (0). All numbers are hexadecimal.
200 31a 0 1
7fffe 54 1 1
7fffd 56 0 0
7ffff 50 1 1
201 6d 1 1
203 aa 0 1
202 4f 1 1
7fffc 97 1 1
If software attempts to access virtual address 0x7fffd257, choose the most accurate answer from the options below.
Select one:
Physical address 0x56257 is accessed, and stores are allowed.
Physical address 0x56 is invalid but stores are allowed.
Physical address 0x56 is accessed
Physical address 0x56257 is invalid, but stores are allowed.
A TLB exception occurs.
The correct answer is: A TLB exception occurs.
Question 50
Not answered
Marked out of
Below is a (somewhat compressed and simplified) snapshot of a TLB with 20 entries.
All mappings use 4 KiB page sizes. “VPN” is the virtual page number, “PFN” is the physical frame
number, “V” indicates if the entry is valid (1) or not (0), and “D” (Dirty) indicates if a valid entry
is writable (1) or not (0). All numbers are hexadecimal.
200 31a 0 1
7fffe 54 1 1
7fffd 56 0 0
7ffff 50 1 1
201 6d 1 1
203 aa 0 1
202 4f 1 1
7fffc 97 1 1
If software attempts to access virtual address 0x200a2f, choose the most accurate answer from the options below.
Select one:
A TLB exception occurs.
Physical address 0x31aa2f is accessed, but stores are not allowed.
Physical address 0x31a is accessed
Physical address 0x31aa2f is accessed, and stores are allowed.
Physical address 0x31a is accessed, but stores are not allowed.
The correct answer is: Physical address 0x31aa2f is accessed, but stores are not allowed.
Question 51
Not answered
Marked out of
Information
Below is a (somewhat compressed and simplified) snapshot of a TLB with 20 entries.
All mappings use 4 KiB page sizes. “VPN” is the virtual page number, “PFN” is the physical frame
number, “V” indicates if the entry is valid (1) or not (0), and “D” (Dirty) indicates if a valid entry
is writable (1) or not (0). All numbers are hexadecimal.
200 31a 0 1
7fffe 54 1 1
7fffd 56 0 0
7ffff 50 1 1
201 6d 1 1
203 aa 0 1
202 4f 1 1
7fffc 97 1 1
If software attempts to access virtual address 0x00005765, choose the most accurate answer from the options below.
Select one:
Physical address 0x6c is accessed
Physical address 0x6c is accessed, and stores are allowed.
Physical address 0x6c765 is accessed, stores are not allowed.
Physical address 0x6c765 is accessed, and stores are allowed.
A TLB exception occurs.
The correct answer is: Physical address 0x6c765 is accessed, and stores are allowed.
This is the last page of the exam.
You can submit your exam by clicking Finish attempt … , and Submit all and finish at the bottom of the page, and confirm via the