GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
YIELD(3) libdill Library Functions YIELD(3)

yield - yields CPU to other coroutines

#include <libdill.h>
int yield(void);
    

By calling this function, you give other coroutines a chance to run.

You should consider using yield when doing lengthy computations which don't have natural coroutine switching points such as socket or channel operations or msleep.

In case of success the function returns 0. In case of error it returns -1 and sets errno to one of the values below.

ECANCELED: Current coroutine was canceled.

for(i = 0; i != 1000000; ++i) {
    expensive_computation();
    yield(); /* Give other coroutines a chance to run. */
}

bundle(3) bundle_go(3) bundle_go_mem(3) bundle_mem(3) bundle_wait(3) go(3) go_mem(3)

libdill

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.