File: threads.html

package info (click to toggle)
python-pywcs 1.11-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 11,888 kB
  • sloc: ansic: 31,441; lex: 6,170; fortran: 6,080; sh: 3,478; python: 3,122; sed: 408; makefile: 76
file content (38 lines) | stat: -rw-r--r-- 3,914 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>WCSLIB 4.8.2: Thread-safety</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="index.html">WCSLIB 4.8.2 and PGSBOX 4.8.2</a>
  </div>
</div>
<div class="contents">
<h1><a class="anchor" name="threads">Thread-safety </a></h1>With the following exceptions WCSLIB 4.8 is thread-safe:<p>
<ul>
<li>The C code generated by Flex is not re-entrant. Flex does have the capacity for producing re-entrant scanners but they have a different API. This may be handled by a compile-time option in future but in the meantime calls to the header parsers should be serialized via a mutex.</li></ul>
<p>
<ul>
<li>The low-level functions <a class="el" href="wcs_8h.html#42b2578d76ace7ca6114d82b7ae46a89" title="Memory allocation for PVi_ma.">wcsnpv()</a> and <a class="el" href="wcs_8h.html#e790c9ce6c9b7a4845cf1c3c97b1e97a" title="Memory allocation for PSi_ma.">wcsnps()</a> are not thread-safe but within the library itself they are only used by the Flex scanners <a class="el" href="wcshdr_8h.html#c75623ee805ab7d43b0bba684c719a60" title="FITS WCS parser routine for image headers.">wcspih()</a> and <a class="el" href="wcshdr_8h.html#dc053d80a9c4da454a52eed34e123633" title="FITS WCS parser routine for binary table and image headers.">wcsbth()</a>. They would rarely need to be used by application programmers.</li></ul>
<p>
<ul>
<li>Diagnostic functions that print the contents of the various structs, namely <a class="el" href="cel_8h.html#db2e4565f61a9de5fe278d9035850dc3" title="Print routine for the celprm struct.">celprt()</a>, <a class="el" href="lin_8h.html#946005b038f5c584691630b5d39369e3" title="Print routine for the linprm struct.">linprt()</a>, <a class="el" href="prj_8h.html#8785bdf33bdaa3d9d52fd51b621ec8d5" title="Print routine for the prjprm struct.">prjprt()</a>, <a class="el" href="spc_8h.html#7304d0d00bcf9d2bad1f56ba6d8322ea" title="Print routine for the spcprm struct.">spcprt()</a>, <a class="el" href="tab_8h.html#6b3768349e9a5e925aab24effddc584f" title="Print routine for the tabprm struct.">tabprt()</a>, <a class="el" href="wcs_8h.html#b9aeb8cf1afb1bfb22e989580d90fca8" title="Print routine for the wcsprm struct.">wcsprt()</a>, and <a class="el" href="wcs_8h.html#8fe5dcd9927240dc0348b850ee662367" title="Print error messages from a wcsprm struct.">wcsperr()</a> use printf() which is thread-safe by the POSIX requirement on <code>stdio</code>. However, this is only at the function level. Where multiple threads invoke these functions simultaneously their output is likely to be interleaved.</li></ul>
<p>
<ul>
<li><a class="el" href="wcserr_8h.html#1691b8bd184d40ca6fda255be078fa53" title="Enable/disable error messaging.">wcserr_enable()</a> sets a static variable and so is not thread-safe. However, this facility is not intended to be used dynamically. If detailed error messages are required, enable <a class="el" href="structwcserr.html" title="Error message handling.">wcserr</a> when execution starts and don't change it. </li></ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Oct 4 19:02:31 2011 for WCSLIB 4.8.2 by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>