File: implementation_notes.xml

package info (click to toggle)
boost 1.33.1-10
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 100,948 kB
  • ctags: 145,103
  • sloc: cpp: 573,492; xml: 49,055; python: 15,626; ansic: 13,588; sh: 2,099; yacc: 858; makefile: 660; perl: 427; lex: 111; csh: 6
file content (34 lines) | stat: -rw-r--r-- 2,020 bytes parent folder | download | duplicates (2)
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
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
  "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
  <!ENTITY % threads.entities SYSTEM "entities.xml">
  %threads.entities;
]>
<section id="threads.implementation_notes" last-revision="$Date: 2004/07/17 04:33:59 $">
	<title>Implementation Notes</title>
	<section id="threads.implementation_notes.win32">
		<title>Win32</title>
		<para>
			In the current Win32 implementation, creating a boost::thread object
			during dll initialization will result in deadlock because the thread 
			class constructor causes the current thread to wait on the thread that 
			is being created until it signals that it has finished its initialization, 
			and, as stated in the
			<ulink url="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/dllmain.asp">MSDN Library, "DllMain" article, "Remarks" section</ulink>,
			"Because DLL notifications are serialized, entry-point functions should not
			attempt to communicate with other threads or processes. Deadlocks may occur as a result."
			(Also see <ulink url="http://www.microsoft.com/msj/archive/S220.aspx">"Under the Hood", January 1996</ulink> 
			for a more detailed discussion of this issue).
		</para>
		<para>
			The following non-exhaustive list details some of the situations that
			should be avoided until this issue can be addressed:
			<itemizedlist>
				<listitem>Creating a boost::thread object in DllMain() or in any function called by it.</listitem>
				<listitem>Creating a boost::thread object in the constructor of a global static object or in any function called by one.</listitem>
				<listitem>Creating a boost::thread object in MFC's CWinApp::InitInstance() function or in any function called by it.</listitem>
				<listitem>Creating a boost::thread object in the function pointed to by MFC's _pRawDllMain function pointer or in any function called by it.</listitem>
			</itemizedlist>
		</para>
	</section>
</section>