---
name: "pthread_yield"
section: "3"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/pthread_yield"
---

# pthread\_yield(3)

yield the processor

## NAME

pthread\_yield - yield the processor

## LIBRARY

POSIX threads library (*libpthread*, *-lpthread*)

## SYNOPSIS

```
#define _GNU_SOURCE             /* See feature_test_macros(7) */
#include <pthread.h>
```

**\[\[deprecated\]\] int pthread\_yield(void);**

## DESCRIPTION

**Note**: This function is deprecated; see below.

**pthread\_yield**() causes the calling thread to relinquish the CPU. The thread is placed at the end of the run queue for its static priority and another thread is scheduled to run. For further details, see [**sched\_yield**(2)](/sched_yield/2.md)

## RETURN VALUE

On success, **pthread\_yield**() returns 0; on error, it returns an error number.

## ERRORS

On Linux, this call always succeeds (but portable and future-proof applications should nevertheless handle a possible error return).

## ATTRIBUTES

For an explanation of the terms used in this section, see [**attributes**(7)](/attributes/7.md).

| | | |
| --- | --- | --- |
| **Interface** | **Attribute** | **Value** |
| **pthread\_yield**() | Thread safety | MT-Safe |

## VERSIONS

On Linux, this function is implemented as a call to [**sched\_yield**(2)](/sched_yield/2.md).

## STANDARDS

None.

## HISTORY

Deprecated since glibc 2.34. Use the standardized [**sched\_yield**(2)](/sched_yield/2.md) instead.

## NOTES

**pthread\_yield**() is intended for use with real-time scheduling policies (i.e., **SCHED\_FIFO** or **SCHED\_RR**). Use of **pthread\_yield**() with nondeterministic scheduling policies such as **SCHED\_OTHER** is unspecified and very likely means your application design is broken.

## SEE ALSO

[**sched\_yield**(2)](/sched_yield/2.md), [**pthreads**(7)](/pthreads/7.md), [**sched**(7)](/sched/7.md)
