- 5
- 0
- 约1.2万字
- 约 45页
- 2017-06-09 发布于浙江
- 举报
* * * * * * * * * * * * * * * * * * * * * * * *** 5.5 Thread Scheduling Local Scheduling – How the threads library decides which thread to put onto an available LWP Global Scheduling – How the kernel decides which kernel thread to run next Pthread Scheduling API #include pthread.h #include stdio.h #define NUM THREADS 5 int main(int argc, char *argv[]) { int i; pthread t tid[NUM THREADS]; pthread attr t attr; /* get the default attributes */ pthread attr init(attr); /* set the scheduling algorithm to PROCESS or SYSTEM */ pthread attr setscope(attr, PTHREAD SCOPE SYSTEM); /* set the
原创力文档

文档评论(0)