Operating System《操作系统》ch05-CPU Scheduling-51.pptVIP

  • 5
  • 0
  • 约1.2万字
  • 约 45页
  • 2017-06-09 发布于浙江
  • 举报

Operating System《操作系统》ch05-CPU Scheduling-51.ppt

* * * * * * * * * * * * * * * * * * * * * * * *** 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)

1亿VIP精品文档

相关文档