source: trunk/doc/src/frameworks-technologies/threads.qdoc@ 564

Last change on this file since 564 was 561, checked in by Dmitry A. Kuminov, 15 years ago

trunk: Merged in qt 4.6.1 sources.

  • Property svn:eol-style set to native
File size: 29.7 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4** All rights reserved.
5** Contact: Nokia Corporation ([email protected])
6**
7** This file is part of the documentation of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:LGPL$
10** Commercial Usage
11** Licensees holding valid Qt Commercial licenses may use this file in
12** accordance with the Qt Commercial License Agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in
14** a written agreement between you and Nokia.
15**
16** GNU Lesser General Public License Usage
17** Alternatively, this file may be used under the terms of the GNU Lesser
18** General Public License version 2.1 as published by the Free Software
19** Foundation and appearing in the file LICENSE.LGPL included in the
20** packaging of this file. Please review the following information to
21** ensure the GNU Lesser General Public License version 2.1 requirements
22** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23**
24** In addition, as a special exception, Nokia gives you certain additional
25** rights. These rights are described in the Nokia Qt LGPL Exception
26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27**
28** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file. Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you have questions regarding the use of this file, please contact
37** Nokia at [email protected].
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42/*!
43 \group thread
44 \title Threading Classes
45*/
46
47/*!
48 \page threads.html
49 \title Thread Support in Qt
50 \brief A detailed discussion of thread handling in Qt.
51
52 \ingroup frameworks-technologies
53
54 \nextpage Starting Threads with QThread
55
56 Qt provides thread support in the form of platform-independent
57 threading classes, a thread-safe way of posting events, and
58 signal-slot connections across threads. This makes it easy to
59 develop portable multithreaded Qt applications and take advantage
60 of multiprocessor machines. Multithreaded programming is also a
61 useful paradigm for performing time-consuming operations without
62 freezing the user interface of an application.
63
64 Earlier versions of Qt offered an option to build the library
65 without thread support. Since Qt 4.0, threads are always enabled.
66
67 \section1 Topics:
68
69 \list
70 \o \l{Recommended Reading}
71 \o \l{The Threading Classes}
72 \o \l{Starting Threads with QThread}
73 \o \l{Synchronizing Threads}
74 \o \l{Reentrancy and Thread-Safety}
75 \o \l{Threads and QObjects}
76 \o \l{Concurrent Programming}
77 \o \l{Thread-Support in Qt Modules}
78 \endlist
79
80 \section1 Recommended Reading
81
82 This document is intended for an audience that has knowledge of,
83 and experience with, multithreaded applications. If you are new
84 to threading see our Recommended Reading list:
85
86 \list
87 \o \l{Threads Primer: A Guide to Multithreaded Programming}
88 \o \l{Thread Time: The Multithreaded Programming Guide}
89 \o \l{Pthreads Programming: A POSIX Standard for Better Multiprocessing}
90 \o \l{Win32 Multithreaded Programming}
91 \endlist
92
93 \section1 The Threading Classes
94
95 These classes are relevant to threaded applications.
96
97 \annotatedlist thread
98
99\omit
100 \list
101 \o QThread provides the means to start a new thread.
102 \o QThreadStorage provides per-thread data storage.
103 \o QThreadPool manages a pool of threads that run QRunnable objects.
104 \o QRunnable is an abstract class representing a runnable object.
105 \o QMutex provides a mutual exclusion lock, or mutex.
106 \o QMutexLocker is a convenience class that automatically locks
107 and unlocks a QMutex.
108 \o QReadWriteLock provides a lock that allows simultaneous read access.
109 \o QReadLocker and QWriteLocker are convenience classes that automatically
110 lock and unlock a QReadWriteLock.