24.05.2014 Views

AIX Version 4.3 Differences Guide

AIX Version 4.3 Differences Guide

AIX Version 4.3 Differences Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>4.3</strong>.2 The M:N Model<br />

In the M:N model, there are two underlying types of pthreads. Those with<br />

PTHREAD_SCOPE_SYSTEM, or system scope contention, otherwise known as<br />

global threads, and those with PTHREAD_SCOPE_PROCESS, or process scope<br />

contention. These threads are known as local threads. There are also two types<br />

of thread schedulers in the system. The <strong>AIX</strong> kernel scheduler schedules all kernel<br />

threads. There is also a user thread scheduler, which schedules the local<br />

pthreads in a process.<br />

Global threads are mapped 1:1 to kernel threads, and hence, are scheduled<br />

exclusively by the <strong>AIX</strong> kernel scheduler. The 1:1 threads model used by prior<br />

releases of <strong>AIX</strong> <strong>Version</strong> 4 only uses global threads.<br />

Process A<br />

Process B<br />

G L L L L L L<br />

User<br />

Pthreads<br />

User Scheduler<br />

VP VP VP<br />

User Scheduler<br />

VP<br />

Pthreads<br />

Library<br />

K<br />

K<br />

K<br />

K<br />

Kernel<br />

Threads<br />

Kernel Scheduler<br />

Kernel<br />

Scheduler<br />

CPU<br />

CPU<br />

Figure 8. M:N Threads Model<br />

The local pthreads are multiplexed over a set of kernel threads by the user<br />

scheduler, which is part of the pthreads library.<br />

<strong>4.3</strong>.3 User Scheduler<br />

The user scheduler is run on a dedicated hidden pthread, which is created when<br />

the pthreads library is initialized in M:N mode at process startup. There is one<br />

user scheduler for each process using the M:N model. The hidden pthread is<br />

created with system scope contention and therefore is scheduled directly by the<br />

kernel scheduler.<br />

72 <strong>AIX</strong> <strong>Version</strong> <strong>4.3</strong> <strong>Differences</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!