Mac OS X
Process Management Saksham
3088
Sakshi Mantri
3197
 Mach Scheduling is based on a system of run queues based on process
priorities.
o Normal Priority
o System High Priority
o Kernel Mode Only
o Real Time
CPU Bound
Threads
Low Priority
I/O Threads High Priority
More CPU Need
Less CPU Need
pThreads API
» pthreads API adjusts the priority of threads within a given task .
pthread_setschedparam(pthread_t , int , struct ) ;
ID Parameters
Influence Scheduling
 Used to create, destroy, and alter kernel threads .
 Kernel threads would be of limited utility without certain services .
Creating Kernel Threads
Created through I/O Kit
• IOCreateThread
• IOThreadSelf
• IOExitThread
Deleting Kernel Threads
Thread_terminate is used to destroy threads.
Before tearing down a thread with thread_terminate :
» Lock the thread .
» Disable any outstanding timers .
Alters priority of running processes.
It takes ID of
• A Process
• A Process Group
• A User
renice priority [[-p]] pid …][[-g] pgrp …] [[-u] user …]
renice –n increment [[-p] pid …] [[-g] pgrp …] [[-u] user …]
-p interpreted to be process ID
-g interpreted to be group ID
-n changing to a particular priority
-u interpreted to be user ID
http://www.apple.com/developer/
Saksham
3088
Sakshi Mantri
3197

Mac os x