It is allowable for a mutex lock to be unlocked by a thread other than its current owner.
True
False
What is the shortcoming of Peterson’s solution?
It does not satisfy the property of progress | ||
It does not satisfy the property of mutual exclusion | ||
It does not satisfy the property of bounded waiting | ||
It can only be utilized with two threads |
Select all properties that may be modified using a properly initialized pthread_attr_t variable.
Set/get thread stack size | ||
Get/set thread scheduling parameters | ||
Set/get detachment state | ||
Get/set thread contention scope |
Because threads do not share a heap, any dynamic memory allocated and passed via argument to a thread function must be freed by both the newly-created thread as well as its creator.
True
False
pthread_cancel() returns upon the successful termination of the target thread.
True
False
Given a four-level page table, how many memory accesses are required to fulfill a single memory access in the worst case (e.g. in the event of a TLB miss)? Include the original program’s memory access in your total as well (i.e. your answer should be greater than 1).
Which of the following statements are true about the pthread_join() function?
Cannot be used on an already-detached thread | ||
Terminates the target thread upon reaching a cancellation point | ||
Blocks and waits for the specified thread to complete | ||
Retrieves the return value of the target thread |
Suppose we have a 48-bit virtual address space with a 64KB page size. Also suppose that page table entries in such a system require 8 bytes each. Fill in the blanks to design a three-level multi-level page table for this system: – – – 16.
Which of the following are benefits of virtual memory?
Improved I/O efficiency | ||
Decreased application load time | ||
The ability to allocate more memory than is currently or physically available | ||
Increased level of multiprogramming | ||
Smaller virtual address space |
Suppose we have a 32-bit virtual address space featuring a 10-10-12 split with a 4KB page size. Now suppose we wish to run a process that requires a maximum of 130MB of memory. What will be the minimum number of frames that would be required to support this amount of memory just accounting for the page tables themselves?
When a thread calls exit(), only the calling thread is terminated.
True
False
Suppose we have a 32-bit virtual address space and a 4KB page size. What is the number of pages required to support an 8MB working set?
In a system utilizing a 32-bit virtual address space, with a 4KB page size, how many virtual pages is it possible to address?
(Write answer as a single integer using only the characters in [0-9]
A first level page table can be stored discontiguously in memory (i.e. it can span multiple non-continuously-addressed pages).
True
False
Match each description of a synchronization primitive to its name.
|
|
Match each description of a synchronization primitive to its name.
|
|
The TLB is used to act as a cache for which of the following?
Page table contents | ||
CPU data cache contents | ||
Secondary storage (i.e. the backing store) | ||
CPU instruction cache contents |
Given a 32-bit virtual address space featuring a 10-10-12 split and a 4-byte PTE size, suppose a process requires 9MB of memory. Given these parameters, what are the minimum and maximum sizes of the page tables needed to support this, depending on the distribution of the 9MB of memory? Write your answer as an integer, representing the number of kilobytes.
Best case / minimal size:
Worst case / maximal size:
It is allowable for a thread that did not previously wait on a semaphore to signal the semaphore.
True
False
On which line is there a problem with the following concurrent code segment?
1. pthread_mutex_lock(&lock);
2. while(niters <= 0) {
3. pthread_cond_wait(&noiters, &lock);
4. pthread_mutex_lock(&lock);
5. }
6. niters–;
7. pthread_mutex_unlock(&lock);
A first level page table must be designed to fit within a single page/frame.
True
False
There are some circumstances in which the virtual page size will not equal the physical frame size of a system.
True
False
Complete the following code segment such that each new thread is passed a unique thread number, represented by i:
int i;
for(i = 1; i <= NUM_THREADS; i++) {
if(pthread_create(&threads[i-1], NULL, cthreadf, ______)) {
fprintf(stderr, “pthread_create failed\n”);
}
}
A counting semaphore that is initialized with a value of 1 is considered a “mutex.”
True
False
In a system using virtual memory, in which the 32-bit virtual address space is divided into a 10-10-12 split, what is the maximum number of second-level page tables that could possibly exist?
Match each description of a concurrent programming solution requirement to its name.
|
|
Which of the following is not shared amount threads running within the same process?
File descriptor table | ||
Address space | ||
Global variables/data | ||
Stack |
It is allowable for a mutex lock to be unlocked by a thread other than its current owner.
True
False
What is the shortcoming of Peterson’s solution?
It does not satisfy the property of progress | ||
It does not satisfy the property of mutual exclusion | ||
It does not satisfy the property of bounded waiting | ||
It can only be utilized with two threads |
Select all properties that may be modified using a properly initialized pthread_attr_t variable.
Set/get thread stack size | ||
Get/set thread scheduling parameters | ||
Set/get detachment state | ||
Get/set thread contention scope |
Because threads do not share a heap, any dynamic memory allocated and passed via argument to a thread function must be freed by both the newly-created thread as well as its creator.
True
False
pthread_cancel() returns upon the successful termination of the target thread.
True
False
Given a four-level page table, how many memory accesses are required to fulfill a single memory access in the worst case (e.g. in the event of a TLB miss)? Include the original program’s memory access in your total as well (i.e. your answer should be greater than 1).
Which of the following statements are true about the pthread_join() function?
Cannot be used on an already-detached thread | ||
Terminates the target thread upon reaching a cancellation point | ||
Blocks and waits for the specified thread to complete | ||
Retrieves the return value of the target thread |
Suppose we have a 48-bit virtual address space with a 64KB page size. Also suppose that page table entries in such a system require 8 bytes each. Fill in the blanks to design a three-level multi-level page table for this system: – – – 16.
Which of the following are benefits of virtual memory?
Improved I/O efficiency | ||
Decreased application load time | ||
The ability to allocate more memory than is currently or physically available | ||
Increased level of multiprogramming | ||
Smaller virtual address space |
Suppose we have a 32-bit virtual address space featuring a 10-10-12 split with a 4KB page size. Now suppose we wish to run a process that requires a maximum of 130MB of memory. What will be the minimum number of frames that would be required to support this amount of memory just accounting for the page tables themselves?
When a thread calls exit(), only the calling thread is terminated.
True
False
Suppose we have a 32-bit virtual address space and a 4KB page size. What is the number of pages required to support an 8MB working set?
In a system utilizing a 32-bit virtual address space, with a 4KB page size, how many virtual pages is it possible to address?
(Write answer as a single integer using only the characters in [0-9]
A first level page table can be stored discontiguously in memory (i.e. it can span multiple non-continuously-addressed pages).
True
False
Match each description of a synchronization primitive to its name.
|
|
Match each description of a synchronization primitive to its name.
|
|
The TLB is used to act as a cache for which of the following?
Page table contents | ||
CPU data cache contents | ||
Secondary storage (i.e. the backing store) | ||
CPU instruction cache contents |
Given a 32-bit virtual address space featuring a 10-10-12 split and a 4-byte PTE size, suppose a process requires 9MB of memory. Given these parameters, what are the minimum and maximum sizes of the page tables needed to support this, depending on the distribution of the 9MB of memory? Write your answer as an integer, representing the number of kilobytes.
Best case / minimal size:
Worst case / maximal size:
It is allowable for a thread that did not previously wait on a semaphore to signal the semaphore.
True
False
On which line is there a problem with the following concurrent code segment?
1. pthread_mutex_lock(&lock);
2. while(niters <= 0) {
3. pthread_cond_wait(&noiters, &lock);
4. pthread_mutex_lock(&lock);
5. }
6. niters–;
7. pthread_mutex_unlock(&lock);
A first level page table must be designed to fit within a single page/frame.
True
False
There are some circumstances in which the virtual page size will not equal the physical frame size of a system.
True
False
Complete the following code segment such that each new thread is passed a unique thread number, represented by i:
int i;
for(i = 1; i <= NUM_THREADS; i++) {
if(pthread_create(&threads[i-1], NULL, cthreadf, ______)) {
fprintf(stderr, “pthread_create failed\n”);
}
}
A counting semaphore that is initialized with a value of 1 is considered a “mutex.”
True
False
In a system using virtual memory, in which the 32-bit virtual address space is divided into a 10-10-12 split, what is the maximum number of second-level page tables that could possibly exist?
Match each description of a concurrent programming solution requirement to its name.
|
|
Which of the following is not shared amount threads running within the same process?
File descriptor table | ||
Address space | ||
Global variables/data | ||
Stack |
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more