Notes on Multithreading in Solaris

Data Structure Summary

Process

Data is contained within a proc structure. proc structure includes:

  1. list of kernel threads for the process
  2. pointer to the process’s virtual address space
  3. user credentials
  4. signal handlers

Light-weight Process (LWP)

Contains the process-control-block, or PCB. The PCB includes:

  1. user-level process registers
  2. system call (syscall) arguments
  3. signal mask
  4. resource usage information
  5. profiling pointers

The LWP also includes:

  1. pointers to the kernel thread associated with the LWP
  2. proc structure for the LWP

See: additional notes on light-weight processes

Kernel-thread

Kernel thread structure contains:

  1. kernel level registers
  2. scheduling class (scheduling info)
  3. dispatch queue links (scheduling info)
  4. stack pointer
  5. pointer to associated LWP
  6. pointer to associated process structure
  7. pointer to CPU structure

CPU

The cpu structure contains per-processor data, including:

  1. pointer to currently executing thread and list of kernel threads
  2. the idle thread for the CPU
  3. current dispatching and scheduling information
  4. other architecture-dependent information

“Interrupts as Threads” Summary

SunOS 5.0 had preallocated threads dedicated to handling interrupts. These threads would perform the interrupt work and the interrupted thread would be “pinned” and could not be scheduled while until the interrupt thread finished.

This eliminates the need of raising and lowering interrupt priority to prevent deadlocks from occurring because an interrupt that wants to lock a mutex interrupts something that already has a lock on the mutex (maybe? 🙂 still a little fuzzy on this part of the paper).

Resources