logo

Crowdly

Browser

Додати до Chrome

2025W Operating Systems (CS-3520-01)

Шукаєте відповіді та рішення тестів для 2025W Operating Systems (CS-3520-01)? Перегляньте нашу велику колекцію перевірених відповідей для 2025W Operating Systems (CS-3520-01) в moodle31.upei.ca.

Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!

Consider a system that has a 16KB address space and 64 byte pages and both page table entries and page directory entries are 4 bytes each. How many bits of a virtual address are needed for the offset?
0%
0%
0%
0%
Переглянути це питання

What is the average response time (rounded to two decimal places) of the following workload using a Multi-Level Feedback Queue (MLFQ) scheduling policy with 4 levels, each with a time-slice of 1s?

  • Job A arrives at time 0s and needs to run on the CPU for 5s
  • Job B arrives at time 4s and needs to run on the CPU for 4s
  • Job C arrives at time 4s and needs to run on the CPU for 4s 

Note: assume that switching between processes is instantaneous (i.e., takes no time. If a job arrives at time t it can begin running at time t). Also assume that jobs perform no I/O operations and that there is no priority boost in this MLFQ.

0%
0%
0%
0%
Переглянути це питання
Consider a system where virtual addresses are 12 bits and pages are 256 bytes. If the Page Frame Number (PFN) is 5 bits, what is the size of physical memory?
0%
0%
0%
0%
Переглянути це питання

Given a base address of 0x4000 and bounds of 0x2000, what would be the physical address for virtual address 0x1500?

0%
0%
0%
0%
Переглянути це питання

What are the potential problems with unlimited direct execution of processes?

Переглянути це питання
What is a key difference between a thread and a process?
0%
0%
0%
0%
Переглянути це питання

If 100 threads all increment a shared variable that is initialized to 0, which of the following answers most accurately represents the possible value(s) of the shared variable after all threads finish? (Note: each thread will increment the variable exactly 1 time)

0%
0%
0%
0%
Переглянути це питання

We want to use a semaphore to ensure that a process that creates a single thread waits until the thread finishes before continuing. To do this, we will have the process call sem_wait() after creating the thread and the child will call sem_post() after it finishes. We are unsure what to initialize the semaphore to, but we decide on -1. What will be the result?

Переглянути це питання

I made a question that was too long to fit on one page, so please see the attached double-gobbler question for the question and the answer options.

Переглянути це питання

After working through multiple incorrect solutions to the single-buffer-slot producer/consumer problem, we have finally settled on the following code with some key new insights including: using condition variables to signal when the buffer is filled and when it has been emptied, and using a while loop instead of an if statement when checking if there is something in the buffer (i.e., the value of count).

int loops;

cond_t cond;

mutex_t mutex;

void *producer(void *arg) {

int i;

for (i = 0; i < loops; i++) {

Pthread_mutex_lock(&mutex);

while (count == 1)

Pthread_cond_wait(&cond, &mutex);

put(i);

Pthread_cond_signal(&cond);

Pthread_mutex_unlock(&mutex);

}

}

void *consumer(void *arg) {

int i;

for (i = 0; i < loops; i++) {

Pthread_mutex_lock(&mutex);

while (count < 2)

Pthread_cond_wait(&cond, &mutex);

int tmp = get();

Pthread_cond_signal(&cond);

Pthread_mutex_unlock(&mutex);

printf("%d\n", tmp);

}

}

Which of the following is true about our code?

Переглянути це питання

Хочете миттєвий доступ до всіх перевірених відповідей на moodle31.upei.ca?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

Browser

Додати до Chrome