ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/concep23.htm

70 lines
3.2 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>Pthread APIs cause asynchronous signals initialization</title>
<!-- Begin Header Records ========================================== -->
<!-- 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. -->
<!-- Change History: -->
<!-- YYMMDD USERID Change description -->
<!-- NETMG2 SCRIPT A converted by B2H R4.1 (346) (CMS) by HOLTJM at -->
<!-- RCHVMW2 on 29 Jan 1999 at 10:01:37 -->
<!--File Edited November 2001 -->
<!--End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!-- Java sync-link -->
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript">
</script>
<h2>Pthread APIs cause asynchronous signals initialization</h2>
<p>When a job is running in i5/OS, by default it is not enabled for POSIX
signals. The system never delivers a Posix signal to a job that is not enabled
for signals.</p>
<p>The job is initialized for signals with the default POSIX signals
environment when any thread in the job calls any API defined to implicitly
enable signals. The main categories of APIs that enable signals are the signals
APIs themselves and some process-related APIs related to signals. For example,
some of the APIs that enable signals are <strong>Qp0sEnableSignals()</strong>,
<strong>kill()</strong>, <strong>sigaction()</strong>, <strong>sigprocmask()</strong>,
<strong>getpid()</strong>, and <strong>spawn()</strong>. After the initialization
for signals occurs within a job, the system can deliver signals to that job if
they are generated by another job or by the system.</p>
<p>When a program in a job uses Pthreads, that job is automatically enabled for
signals when the Pthreads service program is loaded (either dynamically or
statically). Loading the service program that contains the Pthread APIs causes
the job to be initialized for signals, regardless of whether the application
actually calls the pthread APIs. All pthread programs can implicitly receive
signals if another job or the system generates a signal for the threaded
job.</p>
<p>If the application calls <strong>Qp0sDisableSignals()</strong> to disable
signals for the job, the Pthreads APIs do not function correctly. Do not use
<strong>Qp0sDisableSignals()</strong> in a threaded job.</p>
<p>For more information about signals and the APIs mentioned in this section,
see <a href="unix5a1.htm">Signal APIs</a> and <a href="unix11.htm">Process-Related
APIs</a>.</p>
<hr>
<center>
<table cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center">
<a href="rzah4mst.htm">Pthread APIs</a> |
<a href="aplist.htm">APIs by category</a></td>
</tr>
</table>
</center>
</body>
</html>