80 lines
5.5 KiB
HTML
80 lines
5.5 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html lang="en-us" xml:lang="en-us">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="security" content="public" />
|
|
<meta name="Robots" content="index,follow" />
|
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
|
<meta name="DC.Type" content="concept" />
|
|
<meta name="DC.Title" content="Examples: Threads" />
|
|
<meta name="abstract" content="These examples are used throughout this topic." />
|
|
<meta name="description" content="These examples are used throughout this topic." />
|
|
<meta name="DC.Relation" scheme="URI" content="rzahwovepo.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rzahwjavco.htm" />
|
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
|
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
|
|
<meta name="DC.Format" content="XHTML" />
|
|
<meta name="DC.Identifier" content="rzahwcex-codex" />
|
|
<meta name="DC.Language" content="en-us" />
|
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
|
<!-- US Government Users Restricted Rights -->
|
|
<!-- Use, duplication or disclosure restricted by -->
|
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
|
<title>Examples: Threads</title>
|
|
</head>
|
|
<body id="rzahwcex-codex"><a name="rzahwcex-codex"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Examples: Threads</h1>
|
|
<div><p>These examples are used throughout this topic.</p>
|
|
<p>Use the following as examples for your programs: </p>
|
|
<div class="note"><span class="notetitle">Note:</span> By using the code examples, you agree to the terms of the <a href="codedisclaimer.htm">Code license and disclaimer information</a>.</div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="void" border="1" rules="rows"><thead align="left"><tr><th align="left" valign="top" width="50%" id="d0e28">Pthread examples:</th>
|
|
<th align="left" valign="top" width="50%" id="d0e30">Java™ examples:</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr><td align="left" valign="top" width="50%" headers="d0e28 "><ul><li><a href="rzahwe11rx.htm#rzahwe11-e11rx">Example: Set a thread attribute in a Pthread program</a></li>
|
|
<li><a href="rzahwe13rx.htm#rzahwe13-e13rx">Example: Start a thread in a Pthread program</a></li>
|
|
<li><a href="rzahwe10rx.htm#rzahwe10-e10rx">Example: End a thread in a Pthread program</a></li>
|
|
<li><a href="rzahwe12rx.htm#rzahwe12-e12rx">Example: Cancel a thread in a Pthread program</a></li>
|
|
<li><a href="rzahwe14rx.htm#rzahwe14-e14rx">Example: Wait for threads in a Pthread program</a></li>
|
|
<li><a href="rzahwe18rx.htm#rzahwe18-e18rx">Example: Use mutexes in Pthread programs</a></li>
|
|
<li><a href="rzahwe19rx.htm#rzahwe19-e19rx">Example: Use semaphores in Pthread programs to protect shared data</a></li>
|
|
<li><a href="rzahwe17rx.htm#rzahwe17-e17rx">Example: Use condition variables in Pthread programs</a></li>
|
|
<li><a href="rzahwe16rx.htm#rzahwe16-e16rx">Example: Space location locks in Pthread programs</a></li>
|
|
<li><a href="rzahwe15rx.htm#rzahwe15-e15rx">Example: One-time initialization in Pthread programs</a></li>
|
|
<li><a href="rzahwe21rx.htm#rzahwe21-e21rx">Example: Thread-specific data in Pthread programs</a></li>
|
|
<li><a href="rzahwe20rx.htm#rzahwe20-e20rx">Example: Sample flight recorder output from a Pthread program</a></li>
|
|
<li><a href="rzahwrzahwe22e22rx.htm#rzahwe22-e22rx">Example: Work with local SQL databases in multithreaded Pthread programs</a></li>
|
|
</ul>
|
|
</td>
|
|
<td align="left" valign="top" width="50%" headers="d0e30 "><ul><li><a href="rzahwex7rx.htm#rzahwex7-ex7rx">Example: Set a thread attribute in Java</a></li>
|
|
<li><a href="rzahwex1rx.htm#rzahwex1-ex1rx">Example: Start a thread using Java</a></li>
|
|
<li><a href="rzahwex2rx.htm#rzahwex2-ex2rx">Example: End a thread using Java</a></li>
|
|
<li><a href="rzahwex8rx.htm#rzahwex8-ex8rx">Example: Cancel a thread using Java</a></li>
|
|
<li><a href="rzahwex6rx.htm#rzahwex6-ex6rx">Example: Suspend a thread using Java</a></li>
|
|
<li><a href="rzahwex3rx.htm#rzahwex3-ex3rx">Example: Wait for threads using Java</a></li>
|
|
<li><a href="rzahwex4rx.htm#rzahwex4-ex4rx">Example: Use mutexes in Java</a></li>
|
|
<li><a href="rzahwex5rx.htm#rzahwex5-ex5rx">Example: Use condition variables in Java programs</a></li>
|
|
<li><a href="rzahwex9rx.htm#rzahwex9-ex9rx">Example: Thread-specific data in Java programs</a></li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzahwovepo.htm" title="A thread is the path taken by a program while running, the steps performed, and the order in which the steps are performed.">Multithreaded applications</a></div>
|
|
</div>
|
|
<div class="relref"><strong>Related reference</strong><br />
|
|
<div><a href="rzahwjavco.htm" title="You can take advantage of i5/OS kernel threads using the java.lang.Thread class. Java threads operate on top of the i5/OS kernel threads model. Each Java thread is one of many tasks that runs in the process.">Threads considerations for Java language</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |