CMSC 433 Midterm (All Exams Combined) solutions 2023/24
CMSC 433 Midterm (All Exams Combined) solutions 2023/24 1. True/False/Multiple Choice Questions [15 points] (1) True False A program with a race condition will always produce incorrect results. (2) True False If the release() method of a newly constructed semaphore is called before any thread ever calls the semaphore’s acquire() method, the release() method will have no effect. (3) True False The get() method of a FutureTask does not guarantee that it can return a value immediately and as a result, it may block execution in some cases. (4) True False An object’s intrinsic lock must be acquired before the wait(), notify(), and notifyAll() methods can be called on that object. (5) True False A Java thread will enter the BLOCKED state if T(500) is called. (6) True False A Java program will terminate once all user threads have terminated. (7) True False The implementation of Java’s intrinsic locks ensures that threads gain access to the lock in FIFO (first in, first out) order. (8) True False A sleeping thread does not release the locks it holds, while wait() releases the lock on the object that wait() is called on (9) True False Fail-fast iterators can throw a ConcurrentModificationException if the underlying data structure is modified in the middle of iteration. (10) True False start() method of Thread class can be overrideen. (11) True False When intrinsic locks are nested, inner lock must be released before the outer lock. (12) Within a process that is using multiple threads, identify if each of the following resources is shared between the threads, or if each thread gets its own copy (Circle your answer). 1) Stack Shared / Not Shared 2) Heap Shared / Not Shared 3) Program counter Shared / Not Shared 4) Local variables Shared / Not Shared (13) True False ThreadPoolExecutor is an implementation of ExecutorService in the Java standard library? (14) True False A long (64-bit) variable could be written in two separate steps, so by default, there is no atomicity guarantee. (15) True False Multiple threads that belong to one process can be executed on multiple network-connected computers. . . . . . . . . . .
Geschreven voor
- Instelling
- CMSC 433
- Vak
- CMSC 433
Documentinformatie
- Geüpload op
- 8 november 2023
- Aantal pagina's
- 91
- Geschreven in
- 2023/2024
- Type
- Tentamen (uitwerkingen)
- Bevat
- Vragen en antwoorden
Onderwerpen
-
cmsc 433 midterm all exams combined solutions