File: threads.html

package info (click to toggle)
qt4-x11 4%3A4.8.2%2Bdfsg-11
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 701,696 kB
  • sloc: cpp: 2,686,179; ansic: 375,485; python: 25,859; sh: 19,349; xml: 17,091; perl: 14,765; yacc: 5,383; asm: 5,038; makefile: 1,259; lex: 555; ruby: 526; objc: 347; cs: 112; pascal: 112; php: 54; sed: 34
file content (119 lines) | stat: -rw-r--r-- 8,948 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- threads.qdoc -->
  <title>Qt 4.8: Thread Support in Qt</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="content"> 
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
  </div>
  <div class="breadcrumb toolblock">
    <ul>
      <li class="first"><a href="index.html">Home</a></li>
      <!--  Breadcrumbs go here -->
<li>Thread Support in Qt</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
  <link rel="next" href="threads-starting.html" />
<p class="naviNextPrevious headerNavi">
<a class="nextPage" href="threads-starting.html">Starting Threads with QThread</a>
</p><p/>
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#topics">Topics:</a></li>
<li class="level1"><a href="#recommended-reading">Recommended Reading</a></li>
<li class="level1"><a href="#the-threading-classes">The Threading Classes</a></li>
</ul>
</div>
<h1 class="title">Thread Support in Qt</h1>
<span class="subtitle"></span>
<!-- $$$threads.html-description -->
<div class="descr"> <a name="details"></a>
<p>Qt provides thread support in the form of platform-independent threading classes, a thread-safe way of posting events, and signal-slot connections across threads. This makes it easy to develop portable multithreaded Qt applications and take advantage of multiprocessor machines. Multithreaded programming is also a useful paradigm for performing time-consuming operations without freezing the user interface of an application.</p>
<p>Earlier versions of Qt offered an option to build the library without thread support. Since Qt 4.0, threads are always enabled.</p>
<a name="topics"></a>
<h2>Topics:</h2>
<ul>
<li><a href="#recommended-reading">Recommended Reading</a></li>
<li><a href="#the-threading-classes">The Threading Classes</a></li>
<li><a href="threads-starting.html">Starting Threads with QThread</a></li>
<li><a href="threads-synchronizing.html">Synchronizing Threads</a></li>
<li><a href="threads-reentrancy.html">Reentrancy and Thread-Safety</a></li>
<li><a href="threads-qobject.html">Threads and QObjects</a></li>
<li><a href="threads-qtconcurrent.html">Concurrent Programming</a></li>
<li><a href="threads-modules.html">Thread-Support in Qt Modules</a></li>
</ul>
<a name="recommended-reading"></a>
<h2>Recommended Reading</h2>
<p>This document is intended for an audience that has knowledge of, and experience with, multithreaded applications. If you are new to threading see our Recommended Reading list:</p>
<ul>
<li><a href="http://www.amazon.com/exec/obidos/ASIN/0134436989/trolltech/t">Threads Primer: A Guide to Multithreaded Programming</a></li>
<li><a href="http://www.amazon.com/exec/obidos/ASIN/0131900676/trolltech/t">Thread Time: The Multithreaded Programming Guide</a></li>
<li><a href="http://www.amazon.com/exec/obidos/ASIN/1565921151/trolltech/t">Pthreads Programming: A POSIX Standard for Better Multiprocessing</a></li>
<li><a href="http://www.amazon.com/exec/obidos/ASIN/1565922964/trolltech/t">Win32 Multithreaded Programming</a></li>
</ul>
<a name="the-threading-classes"></a>
<h2>The Threading Classes</h2>
<p>These classes are relevant to threaded applications.</p>
<table class="annotated">
<tr class="odd topAlign"><td class="tblName"><p><a href="qtconcurrentrun.html">Asynchronous Run</a></p></td><td class="tblDescr"><p>The &lt;QtConcurrentRun&gt; header provides a way to run a function in a separate thread.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qtconcurrentfilter.html">Concurrent Filter and Filter-Reduce</a></p></td><td class="tblDescr"><p>The &lt;QtConcurrentFilter&gt; header provides concurrent Filter and Filter-Reduce.</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qtconcurrentmap.html">Concurrent Map and Map-Reduce</a></p></td><td class="tblDescr"><p>The &lt;QtConcurrentMap&gt; header provides concurrent Map and MapReduce.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qatomicint.html">QAtomicInt</a></p></td><td class="tblDescr"><p>Platform-independent atomic operations on integers</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qatomicpointer.html">QAtomicPointer</a></p></td><td class="tblDescr"><p>Template class that provides platform-independent atomic operations on pointers</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qfuture.html">QFuture</a></p></td><td class="tblDescr"><p>Represents the result of an asynchronous computation</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qfuturesynchronizer.html">QFutureSynchronizer</a></p></td><td class="tblDescr"><p>Convenience class that simplifies QFuture synchronization</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qfuturewatcher.html">QFutureWatcher</a></p></td><td class="tblDescr"><p>Allows monitoring a QFuture using signals and slots</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qmutex.html">QMutex</a></p></td><td class="tblDescr"><p>Access serialization between threads</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qmutexlocker.html">QMutexLocker</a></p></td><td class="tblDescr"><p>Convenience class that simplifies locking and unlocking mutexes</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qreadlocker.html">QReadLocker</a></p></td><td class="tblDescr"><p>Convenience class that simplifies locking and unlocking read-write locks for read access</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qreadwritelock.html">QReadWriteLock</a></p></td><td class="tblDescr"><p>Read-write locking</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qrunnable.html">QRunnable</a></p></td><td class="tblDescr"><p>The base class for all runnable objects</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qsemaphore.html">QSemaphore</a></p></td><td class="tblDescr"><p>General counting semaphore</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qthread.html">QThread</a></p></td><td class="tblDescr"><p>Platform-independent threads</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qthreadpool.html">QThreadPool</a></p></td><td class="tblDescr"><p>Manages a collection of QThreads</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qthreadstorage.html">QThreadStorage</a></p></td><td class="tblDescr"><p>Per-thread data storage</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qwaitcondition.html">QWaitCondition</a></p></td><td class="tblDescr"><p>Condition variable for synchronizing threads</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qwritelocker.html">QWriteLocker</a></p></td><td class="tblDescr"><p>Convenience class that simplifies locking and unlocking read-write locks for write access</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qtconcurrent.html">QtConcurrent</a></p></td><td class="tblDescr"><p>High-level APIs that make it possible to write multi-threaded programs without using low-level threading primitives</p></td></tr>
</table>
<p><b>Note:</b> Qt's threading classes are implemented with native threading APIs; e.g&#x2e;, Win32 and pthreads. Therefore, they can be used with threads of the same native API.</p>
</div>
<!-- @@@threads.html -->
<p class="naviNextPrevious footerNavi">
<a class="nextPage" href="threads-starting.html">Starting Threads with QThread</a>
</p>
  <div class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2012 Nokia Corporation and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>