Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

QUESTION 4 Which four interprocess communication mechanisms can be used solely f

ID: 3701132 • Letter: Q

Question

QUESTION 4 Which four interprocess communication mechanisms can be used solely for the purpose of synchronization, but not for data tansfer? (Check all four.) Shared memory Pthread mutexes Semaphores Signals Monitors Pipes QUESTION 5 In the many-to-many model (user threads bound one or more to kernel threads), which user thread must be bound one-to-one to a kernel thread to optimize the performance of the application? O The thread that is computationally intensive. The thread that executes the main) function. O The thread that executes the GUI main loop. The thread that often synchronizes with other threads.

Explanation / Answer

Answer 1.

Mutex stands for mutual exclusion and it's the most basic form of synchronization between processes. Mutexes guarantee that only one thread can lock a given mutex. If a code section is surrounded by a mutex locking and unlocking, it's guaranteed that only a thread at a time executes that section of code. When that thread unlocks the mutex, other threads can enter to that code region.

2. Semaphore

A semaphore is a synchronization mechanism between processes based in an internal count that offers two basic operations:

Wait: Tests the value of the semaphore count, and waits if the value is less than or equal than 0. Otherwise, decrements the semaphore count.

Post: Increments the semaphore count. If any process is blocked, one of those processes is awoken.

If the initial semaphore count is initialized to 1, a Wait operation is equivalent to a mutex locking and Post is equivalent to a mutex unlocking. This type of semaphore is known as a binary semaphore.

Although semaphores can be used like mutexes, they have a unique feature: unlike mutexes, a Post operation need not be executed by the same thread/process that executed the Wait operation.

3.Signals

Signals are a limited form of inter-process communication (IPC), typically used in Unix, Unix-like, and other POSIX-compliant operating systems. A signal is an asynchronousnotification sent to a process or to a specific thread within the same process in order to notify it of an event that occurred. Signals originated in 1970s Bell Labs Unix and have been more recently specified in the POSIX standard.

4. Pthread mutex.

Mutex is an abbreviation for "mutual exclusion". Mutex variables are one of the primary means of implementing thread synchronization and for protecting shared data when multiple writes occur.

Answer 2.

The Thread that executes the main() function.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote