Which of the following is NOT a unit for stress?
Considering the code: #include #include #include pthread_…
Considering the code: #include #include #include pthread_mutex_t lock1; pthread_mutex_t lock2; void* thread1(void* arg) { pthread_mutex_lock(&lock1); printf(“Thread 1 acquired lock1\n”); sleep(1); pthread_mutex_lock(&lock2); printf(“Thread 1 acquired lock2\n”); pthread_mutex_unlock(&lock2); pthread_mutex_unlock(&lock1); return NULL; } void* thread2(void* arg) { pthread_mutex_lock(&lock2); printf(“Thread 2 acquired lock2\n”); sleep(1); pthread_mutex_lock(&lock1); printf(“Thread 2 acquired lock1\n”); pthread_mutex_unlock(&lock1); pthread_mutex_unlock(&lock2); return NULL; } int main() { pthread_t t1, t2; pthread_mutex_init(&lock1, NULL); pthread_mutex_init(&lock2, NULL); pthread_create(&t1, NULL, thread1, NULL); pthread_create(&t2, NULL, thread2, NULL); pthread_join(t1, NULL); pthread_join(t2, NULL); pthread_mutex_destroy(&lock1); pthread_mutex_destroy(&lock2); return 0; } What is the MOST likely output?
Which process is MOST likely to suffer starvation in priorit…
Which process is MOST likely to suffer starvation in priority scheduling?
In a client-server socket model, which sequence correctly re…
In a client-server socket model, which sequence correctly represents the communication flow?
A process has: Arrival Time = 1 ms First CPU Allocation = 4…
A process has: Arrival Time = 1 ms First CPU Allocation = 4 ms Completion Time = 15 ms Burst Time = 9 ms What is the waiting time?
Which process state indicates the process is waiting for som…
Which process state indicates the process is waiting for some external event?
Consider the following processes scheduled using Shortest-Re…
Consider the following processes scheduled using Shortest-Remaining-Time-First (SRTF) scheduling: Process Arrival Time Burst Time P1 0 7 P2 2 4 P3 4 1 P4 5 4 Which of the following is the CORRECT execution sequence (Gantt Chart)?
Consider the following RAG: Which statement is CORRECT?
Consider the following RAG: Which statement is CORRECT?
A system satisfies bounded waiting but allows two processes…
A system satisfies bounded waiting but allows two processes simultaneously inside the critical section. Which requirement of solution to critical-section problem fails?
A process: Arrives at time = 2 ms Completes at time = 17 ms…
A process: Arrives at time = 2 ms Completes at time = 17 ms What is the turnaround time?