Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sched_yield(2) [redhat man page]

SCHED_YIELD(2)						     Linux Programmer's Manual						    SCHED_YIELD(2)

NAME
sched_yield - yield the processor SYNOPSIS
#include <sched.h> int sched_yield(void); DESCRIPTION
A process can relinquish the processor voluntarily without blocking by calling sched_yield. The process will then be moved to the end of the queue for its static priority and a new process gets to run. Note: If the current process is the only process in the highest priority list at that time, this process will continue to run after a call to sched_yield. POSIX systems on which sched_yield is available define _POSIX_PRIORITY_SCHEDULING in <unistd.h>. RETURN VALUE
On success, sched_yield returns 0. On error, -1 is returned, and errno is set appropriately. CONFORMING TO
POSIX.1b (formerly POSIX.4) SEE ALSO
sched_setscheduler(2) for a description of Linux scheduling. Programming for the real world - POSIX.4 by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0 IEEE Std 1003.1b-1993 (POSIX.1b standard) ISO/IEC 9945-1:1996 Linux 1.3.81 1996-04-10 SCHED_YIELD(2)

Check Out this Related Man Page

SCHED_YIELD(2)						     Linux Programmer's Manual						    SCHED_YIELD(2)

NAME
sched_yield - yield the processor SYNOPSIS
#include <sched.h> int sched_yield(void); DESCRIPTION
sched_yield() causes the calling thread to relinquish the CPU. The thread is moved to the end of the queue for its static priority and a new thread gets to run. RETURN VALUE
On success, sched_yield() returns 0. On error, -1 is returned, and errno is set appropriately. ERRORS
In the Linux implementation, sched_yield() always succeeds. CONFORMING TO
POSIX.1-2001. NOTES
If the calling thread is the only thread in the highest priority list at that time, it will continue to run after a call to sched_yield(). POSIX systems on which sched_yield() is available define _POSIX_PRIORITY_SCHEDULING in <unistd.h>. Strategic calls to sched_yield() can improve performance by giving other threads or processes a chance to run when (heavily) contended resources (e.g., mutexes) have been released by the caller. Avoid calling sched_yield() unnecessarily or inappropriately (e.g., when resources needed by other schedulable threads are still held by the caller), since doing so will result in unnecessary context switches, which will degrade system performance. SEE ALSO
sched_setscheduler(2) for a description of Linux scheduling. Programming for the real world - POSIX.4 by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0 COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2008-10-18 SCHED_YIELD(2)
Man Page

8 More Discussions You Might Find Interesting

1. HP-UX

System V semphore

Hello,there here is my code about semphore, when calling it in the program,sometimes result in the deadlock of semphore, but I can not find it, anyone can point some bugs and give some suggestion? #define BIGCOUNT 888 // initial value of process counter #define SEM_POST_LIMIT 3 ... (0 Replies)
Discussion started by: Frank2004
0 Replies

2. HP-UX

avoid semphore lock

we developed a set of system V semphore interface for our application, in general, all of them work normal, seldom cause the deadlock. Here are some important sem_wait and sem_post interface, pls point some suggestion to fixed the deadlock problem: int sem_wait_V(int id, struct sembuf *sem_pv)... (1 Reply)
Discussion started by: Frank2004
1 Replies

3. Programming

Interesting issue with pthread_mutex_lock and siglongjmp in AIX 5.3 (and no other OS)

Executive summary: Code (posted below) cores in AIX 5.3, despite being compiled and run successfully on several other operating systems. Code is attempting to verify that pthread_mutex_lock can be successfully aborted by siglongjmp. I do not believe this is an unreasonable requirement. If... (1 Reply)
Discussion started by: DreamWarrior
1 Replies

4. Solaris

Problem building app

trying to run IPERF and i've downloaded and installed and screwed around with my path to get compilers and such available... log in as myself, go to /iperf-2.0.4 switch to su run ./configure seems to go fine, couple of no's but based on previous runs it seems to be ok... do make it goes... (3 Replies)
Discussion started by: jrich523
3 Replies

5. UNIX for Advanced & Expert Users

Pthread attr setting doesn't work before thread create?

Hello everyone, I created a test program for pthread priority set. Here's the code, very simple, 60 lines only. I've tried this prog on my Fedora 13(on vbox), and on my 6410 arm linux 2.6.36. Both the same result. Both environments are using root privileges. Can any body tells me why the... (15 Replies)
Discussion started by: ss1969
15 Replies

6. UNIX for Advanced & Expert Users

Playing with the Linux Scheduler

Hi, To begin with let me explain my system and then I will come to the problem. System: My program forks 2 child processes. These child processes further start 2 user level threads (pthreads) and 2 kernel level threads (kthread). All these threads issue various system calls. I am using... (7 Replies)
Discussion started by: demigod85
7 Replies

7. Programming

libcvd install problem

Hi I'm trying to install libcvd libraries (running Ubuntu 10.10) but get errors, I guesss its saying I miss dc1394v1 and ffmpeg. Altough when looking in synaptic manager I appear to have ffmpeg and libdc1394 (version 2). When I do ./config, after all the checks, I get: Options:... (3 Replies)
Discussion started by: mdop
3 Replies

8. UNIX for Beginners Questions & Answers

NTP synchronised problem in our Centos 7.6 node

Someone, please help on this issue:- Note : for security reason i didn't mention hostnames and ips. ============================================================================== # ntpstat unsynchronised polling server every 1024 s Ntpstat showing unsynchronised. ... (29 Replies)
Discussion started by: shanmugaraj
29 Replies