Following, we have the different configuration parameters that can be configured in a thread.
They are applied on a pthread_attr_t
data type, which must be initialized before being used:
#include <pthread.h > int pthread_attr_init(pthread_attr_t *attr); int pthread_attr_destroy(pthread_attr_t *attr); //getter functions int pthread_attr_getdetachstate(const pthread_attr_t *attr,int *detachstate); int pthread_attr_getinheritsched(const pthread_attr_t *restrict attr,int *restrict inheritsched); int pthread_attr_getschedparam(const pthread_attr_t *restrict attr, struct sched_param *restrict param); int pthread_attr_getschedpolicy(const pthread_attr_t *restrict attr, int *restrict policy); int pthread_attr_getscope(const pthread_attr_t *restrict attr, int *restrict contentionscope); int pthread_attr_getstackaddr(const pthread_attr_t *restrict attr, void **restrict stackaddr); int pthread_attr_getstacksize(const pthread_attr_t *restrict attr,size_t *restrict stacksize); //setter functions int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate); int pthread_attr_setinheritsched(pthread_attr_t *attr, int inheritsched); int pthread_attr_setschedparam(pthread_attr_t *restrict attr, const struct sched_param *restrict param); int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy); int pthread_attr_setscope(pthread_attr_t *attr, int contentionscope); int pthread_attr_setstackaddr(pthread_attr_t *attr, void *stackaddr); int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize);