Skip to Content
PThreads Programming
book

PThreads Programming

by Dick Buttlar, Jacqueline Farrell, Bradford Nichols
September 1996
Intermediate to advanced content levelIntermediate to advanced
286 pages
7h 11m
English
O'Reilly Media, Inc.
Content preview from PThreads Programming

Appendix C. Pthreads Quick Reference

In this appendix, we’ll provide a brief listing of the C language bindings of the Pthreads library routines:

pthread_atfork( )
int pthread_atfork (
void (*prepare)(void),
void (*parent)(void),
void (*child)(void));

Declares procedures to be called before and after a fork call. The prepare fork handler runs in the parent process before the fork. After the fork, the parent handler runs in the parent process, and the child handler runs in the child process.

pthread_attr_destroy( )
int pthread_attr_destroy (
pthread_attr_t *attr);

Destroys a thread attribute object.

pthread_attr_getdetachstate( )
int pthread_attr_getdetachstate (
const pthread_attr_t *attr,
int *detachstate);

Obtains the setting of the detached state of a thread.

pthread_attr_getinheritsched( )
int pthread_attr_getinheritsched (
const pthread_attr_t *attr,
int *inheritsched);

Obtains the setting of the scheduling inheritance of a thread.

pthread_attr_getschedparam( )
int pthread_attr_getschedparam (
const pthread_attr_t *attr,
struct sched_param *param);

Obtains the parameters (for instance, the scheduling priority) associated with the scheduling policy attribute of a thread.

pthread_attr_getschedpolicy( )
int pthread_attr_getschedpolicy (
const pthread_attr_t *attr,
int *policy);

Obtains the setting of the scheduling policy of a thread.

pthread_attr_getscope( )
int pthread_attr_getscope (
const pthread_attr_t *attr,
int *scope);

Obtains the setting of the scheduling scope of a thread.

pthread_attr_getstackaddr( ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming with POSIX ® Threads

Programming with POSIX ® Threads

David R. Butenhof

Publisher Resources

ISBN: 9781449364724Supplemental ContentErrata Page