Ask Question
1 June, 20:19

Can two threads in the same process synchronize using a kernel semaphore if the threads are implemented by the kernel? What if they are implemented in user space? Assume that no threads in any other processes have access to the semaphore. Discuss your answers.

+4
Answers (2)
  1. 1 June, 23:41
    0
    Answered

    Explanation:

    With kernel threads, a thread can block on a semaphore and the kernel can run some other thread in the same process. Consequently, there is no problem using semaphores. With user-level threads, when one thread blocks on a semaphore, the kernel thinks the entire process is blocked and does not run it ever again. Consequently, the process fails.

    OS X uses traditional counting semaphores rather than binary semaphores (which are essentially locks). Mach semaphores obey Mesa semantics
  2. 1 June, 23:58
    0
    Answer and Explanation:

    It can be executed.

    Locks and semaphores are comparative, then again, actually with semaphores, beyond what one string can be doing a given activity on the double.

    Semaphores are regularly utilized when ensuring different undefined source. For instance, you may utilize a semaphore to keep a line from flooding its limits.

    Using kernel threads, a string can hinder on a semaphore and the piece can run some other threads in a similar procedure.

    Therefore, there is no issue utilizing semaphores. With client level threads, when one thread obstructs on a semaphore, the part thinks the whole procedure is blocked and doesn't run it until kingdom come. Therefore, the procedure comes up short.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Can two threads in the same process synchronize using a kernel semaphore if the threads are implemented by the kernel? What if they are ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers