Process Synchronization in Solaris


Solaris implements variety of locks to support multitasking, multithreading and multiprocessing. It uses adaptive mutexes, conditional variables, semaphores, read-write locks, turnstiles to control access to critical sections.

An adaptive mutex uses for protecting every critical data item which are only accessed by short code segments.

On A multiprocessor system it starts as a standard semaphore spin-lock. If the lock is held by a thread which is running on another CPU then the thread spins. If the lock is held by a thread which is currently in run state,the thread blocks, going to sleep until it is awakened by the signal of releasing the lock.

The spin-waiting method is exceedingly inefficient if code segment is longer. So conditional variables, semaphores are used for them.

Solaris provides Read-Write lock to protect the data are frequently accessed by long section of code usually in read-only manner.

It uses turnstiles to order the list of threads waiting to acquire either an adaptive mutex or read-writer lock. Turnstile is a queue structure containing threads blocked on a lock. They are per lock holding thread, not per object. Turnstiles are organized according to priority-inheritance which gives the running thread the highest of the priorities of the threads in its turnstiles to prevent priority inversion.

Locking mechanisms are used by kernel is also used by user-level threads, so that the locks are available both inside and outside of the kernel. The difference is only that priority-inheritance in only used in kernel, user-level thread does not provide this functionality.

To optimize Solaris performance, developers refine the locking methods as locks are used frequently and typically for crucial kernel functions, tuning their implementations and use to gain great performance.

Updated on: 11-Oct-2019

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements