23.07.2013 Views

HP-UX 11i Knowledge-on-Demand

HP-UX 11i Knowledge-on-Demand

HP-UX 11i Knowledge-on-Demand

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Mercury public: initializati<strong>on</strong><br />

• hg_public_init(), hg_public_remove(): Allows a thread to<br />

make its state viewable (and get a viewing handle), or turn<br />

off viewability<br />

− Initializing is <strong>on</strong>ly needed if the calling thread needs to have its own<br />

state viewed by other threads. Viewing the state of another thread<br />

<strong>on</strong>ly requires knowing its handle.<br />

− The handle returned by hg_public_init() must be passed to the<br />

threads who wish to view the state. This is the <strong>on</strong>ly source of the<br />

handle. One way to pass this handle is to put it in a shared lock<br />

structure so that the thread waiting can view the handle owner.<br />

− Remember, <strong>on</strong>ce a thread has made its state viewable, any thread<br />

<strong>on</strong> the system may view it. Not knowing the handle is <strong>on</strong>ly a minor<br />

barrier for some<strong>on</strong>e determined to view that state.<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

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

Saved successfully!

Ooh no, something went wrong!