Шукаєте відповіді та рішення тестів для 2025W Operating Systems (CS-3520-01)? Перегляньте нашу велику колекцію перевірених відповідей для 2025W Operating Systems (CS-3520-01) в moodle31.upei.ca.
Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!
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?
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.
What is a primary advantage of using large pages (e.g., 2MB) compared to standard pages (e.g., 4KB)?
Given a base address of 0x4000 and bounds of 0x2000, what would be the physical address for virtual address 0x1500?
What are the potential problems with unlimited direct execution of processes?
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.
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?
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)
Which of the following is true about the below code for a reader-writer lock that allows multiple readers in a critical section, but never more than one writer and never a writer and readers at the same time.
typedef struct {
sem_t rw_mutex;
sem_t rcount_mutex;
sem_t writer_waiting;
int reader_count;
} rw_lock_t;
void rw_lock_init(rw_lock_t *lock) {
sem_init(&lock->rw_mutex, 0, 1);
sem_init(&lock->rcount_mutex, 0, 1);
sem_init(&lock->writer_waiting, 0, 1);
lock->reader_count = 0;
}
void reader_lock(rw_lock_t *lock) {
sem_wait(&lock->writer_waiting);
sem_wait(&lock->rcount_mutex);
lock->reader_count++;
if (lock->reader_count == 1) {
sem_wait(&lock->rw_mutex);
}
sem_post(&lock->rcount_mutex);
sem_post(&lock->writer_waiting);
}
void reader_unlock(rw_lock_t *lock) {
sem_wait(&lock->rcount_mutex);
lock->reader_count--;
if (lock->reader_count == 0) {
sem_post(&lock->rw_mutex);
}
sem_post(&lock->rcount_mutex);
}
void writer_lock(rw_lock_t *lock) {
sem_wait(&lock->writer_waiting);
sem_wait(&lock->rw_mutex);
}
void writer_unlock(rw_lock_t *lock) {
sem_post(&lock->rw_mutex);
sem_post(&lock->writer_waiting);
}
Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!