Which of the following is not a common method to create a thread in an operating system?
Think about the difference between processes and threads.
fork() creates a new process, not a thread. Threads share the same process space, while fork() duplicates the entire process.
Which of the following is not a typical state in a thread's lifecycle?
Consider which states apply to threads versus processes.
Zombie state applies to processes that have finished execution but still have an entry in the process table. Threads do not have a zombie state.
Consider a system where threads have priorities. If a high-priority thread is ready to run, what is the most likely behavior of the scheduler?
Think about preemptive scheduling and priority.
In priority-based preemptive scheduling, the scheduler interrupts lower-priority threads to run higher-priority ones immediately.
Which statement correctly compares user-level threads and kernel-level threads?
Consider who manages the threads and how scheduling works.
Kernel-level threads are managed and scheduled by the OS kernel independently. User-level threads are managed by user libraries and the kernel sees them as a single process thread.
Given two threads T1 and T2 and two resources R1 and R2, which scenario can cause a deadlock?
Assume each thread locks one resource and waits for the other.
Deadlock happens when threads wait on each other holding resources.
In option D, T1 holds R1 and waits for R2 while T2 holds R2 and waits for R1, causing a circular wait and deadlock.