70 lines
5.2 KiB
HTML
70 lines
5.2 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="Multithreaded programming techniques" />
|
||
|
<meta name="abstract" content="If you are going to write multithreaded applications or server applications for i5/OS, you should be familiar with several techniques." />
|
||
|
<meta name="description" content="If you are going to write multithreaded applications or server applications for i5/OS, you should be familiar with several techniques." />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzahwovepo.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzahwevaco.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzahwsynco.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzahwoneco.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzahwdatco.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzahwnonco.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzahwcomco.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzahwclcco.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="rzahwmul-mulco" />
|
||
|
<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>Multithreaded programming techniques</title>
|
||
|
</head>
|
||
|
<body id="rzahwmul-mulco"><a name="rzahwmul-mulco"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Multithreaded programming techniques</h1>
|
||
|
<div><p>If you are going to write multithreaded applications or server
|
||
|
applications for <span class="keyword">i5/OS™</span>,
|
||
|
you should be familiar with several techniques.</p>
|
||
|
<p>The concepts that are described in this section pertain to all programming
|
||
|
languages. To determine how each language enables these concepts, refer to
|
||
|
the <a href="../rzahg/rzahglanguages.htm">Language</a> topic
|
||
|
in the information center for the specific language.</p>
|
||
|
</div>
|
||
|
<div>
|
||
|
<ul class="ullinks">
|
||
|
<li class="ulchildlink"><strong><a href="rzahwevaco.htm">Existing application evaluation</a></strong><br />
|
||
|
When writing a multithreaded application, you should evaluate all the parts of the application and all the services that it uses for thread safety.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rzahwsynco.htm">Synchronization techniques among threads</a></strong><br />
|
||
|
When you create code that is threadsafe but still benefits from sharing data or resources between threads, the most important aspect of programming becomes the ability to synchronize threads.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rzahwoneco.htm">One-time initialization and thread safety</a></strong><br />
|
||
|
At times, you might want to defer the initialization of resources until a thread requires them. However, your application might require that multiple threads use a certain resource, which requires you to initialize the resource only once in a threadsafe way.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rzahwdatco.htm">Thread-specific data</a></strong><br />
|
||
|
Typical applications that are not threaded use global storage.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rzahwnonco.htm">Function calls that are not thread safe</a></strong><br />
|
||
|
Your multithreaded application at times requires access to functions or system services that are not thread safe. There are few completely safe alternatives for calling these functions.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rzahwcomco.htm">Common multithreaded programming errors</a></strong><br />
|
||
|
Several programming errors often occur when writing multithreaded applications.</li>
|
||
|
</ul>
|
||
|
|
||
|
<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="rzahwclcco.htm" title="The Integrated Language Environment (ILE) CL run time and compiler-generated code are threadsafe. Original program model (OPM) CL programs are not threadsafe.">CL commands and thread safety</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|