HP-UX 11i Knowledge-on-Demand
HP-UX 11i Knowledge-on-Demand
HP-UX 11i Knowledge-on-Demand
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Mercury private: c<strong>on</strong>text switch functi<strong>on</strong>s<br />
• hg_c<strong>on</strong>text_switch_involuntary()/hg_c<strong>on</strong>text_switch_voluntary: returns<br />
number of involuntary/voluntary c<strong>on</strong>text switches since the thread<br />
creati<strong>on</strong><br />
• hg_c<strong>on</strong>text_switch_tries(): involuntary + voluntary<br />
• hg_setcrit(): requests the kernel to start (or stop) taking involuntary<br />
c<strong>on</strong>text switches; more <strong>on</strong> hg_setcrit() next page<br />
• A c<strong>on</strong>text switch, in the <str<strong>on</strong>g>HP</str<strong>on</strong>g>-<str<strong>on</strong>g>UX</str<strong>on</strong>g> kernel, occurs when a processor begins<br />
to execute a thread (“switch in”) or when it ceases to execute a thread<br />
(“switch out”).<br />
− A voluntary c<strong>on</strong>text switch occurs when a thread switches out as a result of<br />
acti<strong>on</strong>s it is taking—e.g., reading from a disk, or taking a page fault.<br />
− An involuntary c<strong>on</strong>text switch occurs when a thread is switched out as a<br />
result of kernel policy decisi<strong>on</strong>s—e.g., end of a time slice, or a higherpriority<br />
thread has become runnable.<br />
<str<strong>on</strong>g>HP</str<strong>on</strong>g>-<str<strong>on</strong>g>UX</str<strong>on</strong>g> <str<strong>on</strong>g>11i</str<strong>on</strong>g> v3 Training