Go to main content

STREAMS Programming Guide

Exit Print View

Updated: November 2020
 
 

Multithreaded (MT) STREAMS Overview

The Oracle Solaris operating system is fully multithreaded, which means that it can make effective use of the available parallelism of a symmetric shared-memory multiprocessor computer. All kernel subsystems are multithreaded: scheduler, virtual memory, file systems, block/character/STREAMS I/O, networking protocols, and device drivers.

MT STREAMS requires you to use some different concepts and terminology. These concepts apply not only to STREAMS drivers, but to all device drivers in the Oracle Solaris operating environment. For more description of these terms, see Writing Device Drivers in Oracle Solaris 11.4. For definitions, see Overview of STREAMS and for elements of MT drivers, see STREAMS Kernel-Level Mechanisms.

Some of the multithreaded terms and ideas are.

Thread

Sequence of instructions executed within context of a process.

Lock

Mechanism to restrict access to data structures.

Single Threaded

Restricting access to a single thread.

Multithreaded

Allowing two or more threads access to a data element.

Multiprocessing

Two or more CPUs concurrently executing the operating system.

Concurrency

Simultaneous execution.

Preemption

Suspending execution for the next thread to run.

Monitor

Portion of code that is single-threaded.

Mutual Exclusion

Exclusive access to a data element by a single thread at one time.

Condition Variables

Kernel event synchronization primitives.

Counting Semaphores

Memory-based synchronization mechanism.

Readers/Writer Locks

Data lock allowing one writer or many readers at one time.

Callback

On occurrence of a specific event, call a module function.

Synchronous Access

Only one thread is allowed in the perimeter. Upon return from a call the action is complete; when the thread is done, the job is done.

Asynchronous Access

Multiple threads are allowed in the perimeter. Upon return form a call there is no guarantee that the job is complete.

Perimeter Claim

A thread has synchronous access in the perimeter. The claim prevents subsequent synchronous access until the claim is released.

Exclusive Access

Calling a synchronous entry point in the perimeter.

Writer

A thread that has exclusive access to a perimeter.