Documente Academic
Documente Profesional
Documente Cultură
Kernel Approximately 1 KB This memory is used to store the thread data structures and
data attributes, much of which is allocated as wired memory and
structure therefore cannot be paged to disk.
s
Stack 512 KB (secondary The minimum allowed stack size for secondary threads is 16 KB
space threads) and the stack size must be a multiple of 4 KB. The space for this
memory is set aside in your process space at thread creation time,
8 MB (OS X main thread) but the actual pages associated with that memory are not created
1 MB (iOS main thread) until they are needed.
Creation Approximately 90 This value reflects the time between the initial call to create the
time microseconds thread and the time at which the thread’s entry point routine began
executing. The figures were determined by analyzing the mean
and median values generated during thread creation on an Intel-
based iMac with a 2 GHz Core Duo processor and 1 GB of RAM
running OS X v10.5.
CREATING A THREAD
Creating low-level threads is relatively simple. In all
cases, you must have a function or method to act as
your thread’s main entry point and you must use one
of the available thread routines to start your thread.
The following sections show the basic creation
process for the more commonly used thread
technologies.
METHODS OF CREATING THREADS:
● Using NSThread
● Usinf Posix Thread
SCHEDULING
SCHEDULING
• CPU scheduling is a process which allows one
process to use the CPU while the execution of
another process is on hold(in waiting state).
• The aim of scheduling is to make the system
efficient, fast and user friendly.
• Criterias for best scheduling algorithms:
– CPU utilization
– Throughput
– Turn around time
– Waiting time
– Load average
– Response time
• Mac OS uses cooperative scheduling for
threads
– Controls multiple cooperative threads
– Provides preemptive scheduling for
multiprocessing tasks.
• The kernel schedules multiprocessing tasks
using a preemptive scheduling algorithm.
• Currently, Mac OS supports time-sharing and
fixed-priority scheduling.
• Mac OS supports the multilevel feedback queue
scheduling and round-robin (RR) scheduling
algorithm.
Three queues:
• Q0 – RR with time
quantum 8 milliseconds
•Q1 – RR time quantum
16 milliseconds
•Q2 – FCFS
MEMORY MANAGEMENT
MEMORY MANAGEMENT