man pages section 3: Basic Library Functions

Exit Print View

Updated: July 2014
 
 

smt_pause(3C)

Name

smt_pause - busy wait idle function

Synopsis

#include <synch.h>

void smt_pause(void);

Description

The smt_pause() function delays for a short implementation-dependent period before returning to the caller, consuming as few processor resources as possible. This primitive is recommended for use in busy wait loops to lessen the impact the loop has on the rest of the system. For example, on CMT systems it enables other hardware strands sharing the core to go faster during the busy wait.

Usage

Typical usage is as follows:

volatile int *wait;
while (*wait == 1)
      smt_pause();

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
MT-Level
MT-Safe

See also

attributes(5)