Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/regex/doc/thread_safety.html @ 12

Last change on this file since 12 was 12, checked in by landauf, 18 years ago

added boost

File size: 3.8 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<html>
3   <head>
4      <title>Boost.Regex: Thread Safety</title>
5      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6      <link rel="stylesheet" type="text/css" href="../../../boost.css">
7   </head>
8   <body>
9      <P>
10         <TABLE id="Table1" cellSpacing="1" cellPadding="1" width="100%" border="0">
11            <TR>
12               <td valign="top" width="300">
13                  <h3><a href="../../../index.htm"><img height="86" width="277" alt="C++ Boost" src="../../../boost.png" border="0"></a></h3>
14               </td>
15               <TD width="353">
16                  <H1 align="center">Boost.Regex</H1>
17                  <H2 align="center">Thread Safety</H2>
18               </TD>
19               <td width="50">
20                  <h3><a href="index.html"><img height="45" width="43" alt="Boost.Regex Index" src="uarrow.gif" border="0"></a></h3>
21               </td>
22            </TR>
23         </TABLE>
24      </P>
25      <HR>
26      <P>The regex library is thread safe when Boost is: you can verify that Boost is in
27         thread safe mode by checking to see if BOOST_HAS_THREADS is defined: this macro
28         is set automatically by the config system when threading support is turned on
29         in your compiler.
30      </P>
31      <P>Class <A href="basic_regex.html">basic_regex</A>&lt;&gt; and its typedefs regex
32         and wregex are thread safe, in that compiled regular expressions can safely be
33         shared between threads. The matching algorithms <A href="regex_match.html">regex_match</A>,
34         <A href="regex_search.html">regex_search</A>, <A href="regex_grep.html">regex_grep</A>,
35         <A href="regex_format.html">regex_format</A> and <A href="regex_merge.html">regex_merge</A>
36         are all re-entrant and thread safe. Class <A href="match_results.html">match_results</A>
37         is now thread safe, in that the results of a match can be safely copied from
38         one thread to another (for example one thread may find matches and push
39         match_results instances onto a queue, while another thread pops them off the
40         other end), otherwise use a separate instance of <A href="match_results.html">match_results</A>
41         per thread.
42      </P>
43      <P>The <A href="posix_api.html">POSIX API functions</A> are all re-entrant and
44         thread safe, regular expressions compiled with <I>regcomp</I> can also be
45         shared between threads.
46      </P>
47      <P>The class<A href="regex.html"> RegEx</A> is only thread safe if each thread
48         gets its own RegEx instance (apartment threading) - this is a consequence of
49         RegEx handling both compiling and matching regular expressions.
50      </P>
51      <P>Finally note that changing the global locale invalidates all compiled regular
52         expressions, therefore calling <I>set_locale</I> from one thread while another
53         uses regular expressions <I>will</I> produce unpredictable results.
54      </P>
55      <P>
56         There is also a requirement that there is only one thread executing prior to
57         the start of main().</P>
58      <HR>
59      <p>Revised
60         <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan --> 
61         24 Oct 2003
62         <!--webbot bot="Timestamp" endspan i-checksum="39359" --></p>
63      <p><i>© Copyright John Maddock&nbsp;1998-
64            <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan --> 
65            2003<!--webbot bot="Timestamp" endspan i-checksum="39359" --></i></p>
66      <P><I>Use, modification and distribution are subject to the Boost Software License,
67            Version 1.0. (See accompanying file <A href="../../../LICENSE_1_0.txt">LICENSE_1_0.txt</A>
68            or copy at <A href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</A>)</I></P>
69   </body>
70</html>
Note: See TracBrowser for help on using the repository browser.