Looking for CMPT 334 A - Principles of Operating Systems (FA 2025) test answers and solutions? Browse our comprehensive collection of verified answers for CMPT 334 A - Principles of Operating Systems (FA 2025) at learn.twu.ca.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
Written 4: Organizing Servers
Preamble: A special OS is developed for client-server architectures, computers designed to handle many simultaneous requests from the internet. For example, the OS would provide system calls for listening to network requests and provide convenience features to utilize very powerful server hardware the OS would be installed on. The goal is to allow for the management of thousands of requests per second. Programmers can then develop specific programs to handled an process these requests. For example, Whether-A-Wombat mentioned in Unit 2 could benefit from such a service in receiving and processing requests for machine learning applied on images.
Part A (17 marks): Compare and contrast how a programmer would prevent deadlock in system programs versus user programs for this server-based OS.Which of the deadlock approaches would you use for both cases? Suggested Length: 3-4 Sentences.
For Part B (18 marks): Answer exactly one of the following prompts. Please don't answer more than one! Also, clearly indicate which one you are answering.
Alternative Choice B.1: Discuss how multithreading and synchronization is used in this set-up. Suggested Length: 3-4 Sentences.
Alternative Choice B.2: Respond to the following: this server should use hardware-based synchronization solutions rather than software based because hardware based is faster. Suggested Length: 3-4 Sentences.
Alternative Choice B.3: How would Unit 5A or 5B topics be important in this scenario? Suggested Length: 3-4 Sentences. You should mention at least two technical topics.
Written 4: Organizing Servers
Preamble: A special OS is developed for client-server architectures, computers designed to handle many simultaneous requests from the internet. For example, the OS would provide system calls for listening to network requests and provide convenience features to utilize very powerful server hardware the OS would be installed on. The goal is to allow for the management of thousands of requests per second. Programmers can then develop specific programs to handled an process these requests. For example, Whether-A-Wombat mentioned in Unit 2 could benefit from such a service in receiving and processing requests for machine learning applied on images.
Part A (17 marks): Compare and contrast how a programmer would prevent deadlock in system programs versus user programs for this server-based OS.Which of the deadlock approaches would you use for both cases? Suggested Length: 3-4 Sentences.
For Part B (18 marks): Answer exactly one of the following prompts. Please don't answer more than one! Also, clearly indicate which one you are answering.
Alternative Choice B.1: Discuss how multithreading and synchronization is used in this set-up. Suggested Length: 3-4 Sentences.
Alternative Choice B.2: Respond to the following: this server should use hardware-based synchronization solutions rather than software based because hardware based is faster. Suggested Length: 3-4 Sentences.
Alternative Choice B.3: How would Unit 5A or 5B topics be important in this scenario? Suggested Length: 3-4 Sentences. You should mention at least two technical topics.
Written 1: Organizing Stores (18 marks)
From the Salvation Army website: Salvation Army food banks provide non-perishable and fresh food (when available) to anyone experiencing food shortage. This assistance often starts a conversation around getting more comprehensive support from one our many community programs and services.
A major question is how to decide who gets food first based on issues such as employment or whether they are from the food bank's region. Suppose that there is a group of people queued up for meals and the food bank's manager must decide who to serve first.
a 3 marks) Fill in the blank, this is an example of... Suggested Length: 2-3 Words.b 10 marks) Suggest and justify an algorithm for this situation. Suggested Length: 2-3 sentences.c 5 marks) Suppose the problem was changed so that if a user complains during each hour (e.g., 9 AM to 10 AM) they move up to the front of the line. Describe the type of solution (Suggested length: 1 sentence). What are some issues with applying this approach in the real world? (Suggested Length: 2-3 sentences). As in, even if an OS can run this solution properly what would go wrong if it was applied this in this real world situation...
Written 2: Obligatory Synchronization and Multithreading Programming Questions (27 marks)Note: This question involves coding so it may better to not spend too long working on it without reading the other questions! Also part a and b are separate questions.Part a 18 marks)
Suppose the Memory Management Unit stores records of each processes' base and limit value per Unit 5A. These structures are stored in three different queues: an OS process queue, a high priority queue, and a low priority queue.
Write pseudocode to find the average allocated memory of all processes. Pseudocode is fine as well as using shorthand like "<insert all relevant headers>" or changing functions to be easier to deal with.
You may assume the following struct is used or develop your own: struct node{ int base; int limit; int process_id;
node* next; //A link to the next node node* back; //A link to the previous node.}
Part b 9 marks)
The nuclear reactor that powers Wombat OS' machine learning core has three processes that manages its runtime. You are asked to ensure that process 1 runs its statement 1 (e.g., initialize the reactor) first, then process 2 runs statement 2 (e.g., fill the reactor with water), then process 3 run statement 3 (e.g., run the reactor) using synchronization tools. Any out of sequence running of these statements would result in an explosion (e.g., Statement 3 runs before Statement 1). No justification for your code is necessary but it may help for marking. Pseudocode is fine as well as notation like P1: dothing(value) //Do a thing related to unit 4. S1 //This run statements 1
Written 4: Organizing Servers
Preamble: A special OS is developed for client-server architectures, computers designed to handle many simultaneous requests from the internet. For example, the OS would provide system calls for listening to network requests and provide convenience features to utilize very powerful server hardware the OS would be installed on. The goal is to allow for the management of thousands of requests per second. Programmers can then develop specific programs to handled an process these requests. For example, Whether-A-Wombat mentioned in Unit 2 could benefit from such a service in receiving and processing requests for machine learning applied on images.
Part A (17 marks): Compare and contrast how a programmer would prevent deadlock in system programs versus user programs for this server-based OS.Which of the deadlock approaches would you use for both cases? Suggested Length: 3-4 Sentences.
For Part B (18 marks): Answer exactly one of the following prompts. Please don't answer more than one! Also, clearly indicate which one you are answering.
Alternative Choice B.1: Discuss how multithreading and synchronization is used in this set-up. Suggested Length: 3-4 Sentences.
Alternative Choice B.2: Respond to the following: this server should use hardware-based synchronization solutions rather than software based because hardware based is faster. Suggested Length: 3-4 Sentences.
Alternative Choice B.3: How would Unit 5A or 5B topics be important in this scenario? Suggested Length: 3-4 Sentences. You should mention at least two technical topics.
Written 3: On Studying (20 marks)
Describe in 1-2 sentences each how you would solve each of the following issues. Similar to the first midterm you don't need much detail. The goal is to apply your knowledge of OS concepts to engineer reasonable solutions to these problems.4 marks each. a) A developer wants to ensure only one process can be added to the ready queue at a time to ensure data integrity (as in, the data structure works correctly).b) Philosophers dine with forks instead of chopsticks and only need one fork to eat. Assume all other parameters are the same for the usual dining philosopher problem.c) A database manages class information for TWU. The system wants to ensure that students cannot enroll over the class limit of 35 students.d) A database manages class information for TWU. Programmers wants to ensure that many students can simultaneously access information without there being inconsistencies from staff updating it at the same time.e) Two Operating System processes are compiled with absolute locations for improved speed.
Written 1: Organizing Stores (18 marks)
From the Salvation Army website: Salvation Army food banks provide non-perishable and fresh food (when available) to anyone experiencing food shortage. This assistance often starts a conversation around getting more comprehensive support from one our many community programs and services.
A major question is how to decide who gets food first based on issues such as employment or whether they are from the food bank's region. Suppose that there is a group of people queued up for meals and the food bank's manager must decide who to serve first.
a 3 marks) Fill in the blank, this is an example of... Suggested Length: 2-3 Words.b 10 marks) Suggest and justify an algorithm for this situation. Suggested Length: 2-3 sentences.c 5 marks) Suppose the problem was changed so that if a user complains during each hour (e.g., 9 AM to 10 AM) they move up to the front of the line. Describe the type of solution (Suggested length: 1 sentence). What are some issues with applying this approach in the real world? (Suggested Length: 2-3 sentences). As in, even if an OS can run this solution properly what would go wrong if it was applied this in this real world situation...
Written 2: Obligatory Synchronization and Multithreading Programming Questions (27 marks)Note: This question involves coding so it may better to not spend too long working on it without reading the other questions! Also part a and b are separate questions.Part a 18 marks)
Suppose the Memory Management Unit stores records of each processes' base and limit value per Unit 5A. These structures are stored in three different queues: an OS process queue, a high priority queue, and a low priority queue.
Write pseudocode to find the average allocated memory of all processes. Pseudocode is fine as well as using shorthand like "<insert all relevant headers>" or changing functions to be easier to deal with.
You may assume the following struct is used or develop your own: struct node{ int base; int limit; int process_id;
node* next; //A link to the next node node* back; //A link to the previous node.}
Part b 9 marks)
The nuclear reactor that powers Wombat OS' machine learning core has three processes that manages its runtime. You are asked to ensure that process 1 runs its statement 1 (e.g., initialize the reactor) first, then process 2 runs statement 2 (e.g., fill the reactor with water), then process 3 run statement 3 (e.g., run the reactor) using synchronization tools. Any out of sequence running of these statements would result in an explosion (e.g., Statement 3 runs before Statement 1). No justification for your code is necessary but it may help for marking. Pseudocode is fine as well as notation like P1: dothing(value) //Do a thing related to unit 4. S1 //This run statements 1
Upload any file/files here. This is for word documents, pictures, or writing code in a text file if that is the easiest way to answer something. Feel free to email them to me too for a backup
Suppose there is a mutex m_1 and a mutex m_2 where m_1 locks the first half of an array and m_2 is a lock for the second half of an array.Suppose process 1 has the following code: lock(m_1)lock(m_2)//Do analysisrelease(m_1)release(m_2)And process 2 has the following code: lock(m_2)lock(m_1)//Do analysisrelease(m_2)release(m_1)What are issues with this code?