Skip to content

Commit 9d34262

Browse files
author
mikeblome
committed
updated MFC multithreading topics a bit
1 parent a705fb7 commit 9d34262

22 files changed

Lines changed: 86 additions & 87 deletions

docs/c-language/thread-local-storage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.workload: ["cplusplus"]
1414
# Thread Local Storage
1515
**Microsoft Specific**
1616

17-
Thread Local Storage (TLS) is the mechanism by which each thread in a given multithreaded process allocates storage for thread-specific data. In standard multithreaded programs, data is shared among all threads of a given process, whereas thread local storage is the mechanism for allocating per-thread data. For a complete discussion of threads, see [Processes and Threads](http://msdn.microsoft.com/library/windows/desktop/ms684841) in the Windows SDK.
17+
Thread Local Storage (TLS) is the mechanism by which each thread in a given multithreaded process allocates storage for thread-specific data. In standard multithreaded programs, data is shared among all threads of a given process, whereas thread local storage is the mechanism for allocating per-thread data. For a complete discussion of threads, see [Processes and Threads](/windows/desktop/ProcThread/processes-and-threads) in the Windows SDK.
1818

1919
The Microsoft C language includes the extended storage-class attribute, thread, which is used with the __declspec keyword to declare a thread local variable. For example, the following code declares an integer thread local variable and initializes it with a value:
2020

docs/mfc/tn064-apartment-model-threading-in-activex-controls.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ms.workload: ["cplusplus"]
2323

2424
However, different instances of the same type of control may be assigned to different apartments. So, if multiple instances of a control share any data in common (for example, static or global data), then access to this shared data will need to be protected by a synchronization object, such as a critical section.
2525

26-
For complete details on the apartment threading model, please see [Processes and Threads](http://msdn.microsoft.com/library/windows/desktop/ms684841) in the *OLE Programmer's Reference*.
26+
For complete details on the apartment threading model, please see [Processes and Threads](/windows/desktop/ProcThread/processes-and-threads) in the *OLE Programmer's Reference*.
2727

2828
## Why Support Apartment-Model Threading
2929
Controls that support apartment-model threading can be used in multithreaded container applications that also support the apartment model. If you do not enable apartment-model threading, you will limit the potential set of containers in which your control could be used.

docs/parallel/avoiding-problem-areas-with-multithread-programs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.author: "mblome"
1212
ms.workload: ["cplusplus"]
1313
---
1414
# Avoiding Problem Areas with Multithread Programs
15-
There are several problems you might encounter in creating, linking, or executing a multithread C program. Some of the more common problems are described in the following table. (For a similar discussion from the MFC point of view, see [Multithreading: Programming Tips](../parallel/multithreading-programming-tips.md).)
15+
There are several problems you might encounter in creating, linking, or executing a multithread C program. Some of the more common problems are described in the following table. (For a similar discussion from the MFC point of view, see [Multithreading: Programming Tips](multithreading-programming-tips.md).)
1616

1717
|Problem|Probable cause|
1818
|-------------|--------------------|
@@ -21,4 +21,4 @@ There are several problems you might encounter in creating, linking, or executin
2121

2222
## See Also
2323

24-
[Multithreading with C and Win32](../parallel/multithreading-with-c-and-win32.md)
24+
[Multithreading with C and Win32](multithreading-with-c-and-win32.md)

docs/parallel/c-run-time-library-functions-for-thread-control.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ The [_endthread](../c-runtime-library/reference/endthread-endthreadex.md) functi
3939

4040
## See Also
4141

42-
[Multithreading with C and Win32](../parallel/multithreading-with-c-and-win32.md)
42+
[Multithreading with C and Win32](multithreading-with-c-and-win32.md)

docs/parallel/compiling-and-linking-multithread-programs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.author: "mblome"
1212
ms.workload: ["cplusplus"]
1313
---
1414
# Compiling and Linking Multithread Programs
15-
The Bounce.c program is introduced in [Sample Multithread C Program](../parallel/sample-multithread-c-program.md).
15+
The Bounce.c program is introduced in [Sample Multithread C Program](sample-multithread-c-program.md).
1616

1717
Programs are compiled multithreaded by default.
1818

@@ -38,4 +38,4 @@ Programs are compiled multithreaded by default.
3838
3939
## See Also
4040
41-
[Multithreading with C and Win32](../parallel/multithreading-with-c-and-win32.md)
41+
[Multithreading with C and Win32](multithreading-with-c-and-win32.md)

docs/parallel/include-files-for-multithreading.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ Standard include files declare C run-time library functions as they are implemen
1616

1717
## See Also
1818

19-
[Multithreading with C and Win32](../parallel/multithreading-with-c-and-win32.md)
19+
[Multithreading with C and Win32](multithreading-with-c-and-win32.md)

docs/parallel/library-support-for-multithreading.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ See [CRT Library Features](../c-runtime-library/crt-library-features.md) for mor
1818

1919
## See Also
2020

21-
[Multithreading with C and Win32](../parallel/multithreading-with-c-and-win32.md)
21+
[Multithreading with C and Win32](multithreading-with-c-and-win32.md)

docs/parallel/multithread-programs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ A thread is basically a path of execution through a program. It is also the smal
1616

1717
A process consists of one or more threads and the code, data, and other resources of a program in memory. Typical program resources are open files, semaphores, and dynamically allocated memory. A program executes when the system scheduler gives one of its threads execution control. The scheduler determines which threads should run and when they should run. Threads of lower priority might have to wait while higher priority threads complete their tasks. On multiprocessor machines, the scheduler can move individual threads to different processors to balance the CPU load.
1818

19-
Each thread in a process operates independently. Unless you make them visible to each other, the threads execute individually and are unaware of the other threads in a process. Threads sharing common resources, however, must coordinate their work by using semaphores or another method of interprocess communication. For more information about synchronizing threads, see [Writing a Multithreaded Win32 Program](../parallel/writing-a-multithreaded-win32-program.md).
19+
Each thread in a process operates independently. Unless you make them visible to each other, the threads execute individually and are unaware of the other threads in a process. Threads sharing common resources, however, must coordinate their work by using semaphores or another method of interprocess communication. For more information about synchronizing threads, see [Writing a Multithreaded Win32 Program](writing-a-multithreaded-win32-program.md).
2020

2121
## See Also
2222

23-
[Multithreading with C and Win32](../parallel/multithreading-with-c-and-win32.md)
23+
[Multithreading with C and Win32](multithreading-with-c-and-win32.md)

docs/parallel/multithreading-and-locales.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ unsigned __stdcall RunThreadB(void *params)
433433

434434
## See Also
435435

436-
[Multithreading Support for Older Code (Visual C++)](../parallel/multithreading-support-for-older-code-visual-cpp.md)
436+
[Multithreading Support for Older Code (Visual C++)](multithreading-support-for-older-code-visual-cpp.md)
437437
[_beginthread, _beginthreadex](../c-runtime-library/reference/beginthread-beginthreadex.md)
438438
[_configthreadlocale](../c-runtime-library/reference/configthreadlocale.md)
439439
[setlocale](../preprocessor/setlocale.md)

docs/parallel/multithreading-creating-user-interface-threads.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: "Multithreading: Creating User-Interface Threads | Microsoft Docs"
2+
title: "Multithreading: Creating MFC User-Interface Threads | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "08/27/2018"
55
ms.technology: ["cpp-parallel"]
66
ms.topic: "conceptual"
77
f1_keywords: ["CREATE_SUSPENDED", "SECURITY_ATTRIBUTES"]
@@ -12,7 +12,7 @@ author: "mikeblome"
1212
ms.author: "mblome"
1313
ms.workload: ["cplusplus"]
1414
---
15-
# Multithreading: Creating User-Interface Threads
15+
# Multithreading: Creating MFC User-Interface Threads
1616
A user-interface thread is commonly used to handle user input and respond to user events independently of threads executing other portions of the application. The main application thread (provided in your `CWinApp`-derived class) is already created and started for you. This topic describes the steps necessary to create additional user-interface threads.
1717

1818
The first thing you must do when creating a user-interface thread is derive a class from [CWinThread](../mfc/reference/cwinthread-class.md). You must declare and implement this class, using the [DECLARE_DYNCREATE](../mfc/reference/run-time-object-model-services.md#declare_dyncreate) and [IMPLEMENT_DYNCREATE](../mfc/reference/run-time-object-model-services.md#implement_dyncreate) macros. This class must override some functions and can override others. These functions and what they should do are presented in the following table.
@@ -21,7 +21,6 @@ The first thing you must do when creating a user-interface thread is derive a cl
2121

2222
|Function|Purpose|
2323
|--------------|-------------|
24-
2524
|[ExitInstance](../mfc/reference/cwinthread-class.md#exitinstance)|Perform cleanup when thread terminates. Usually overridden.|
2625
|[InitInstance](../mfc/reference/cwinthread-class.md#initinstance)|Perform thread instance initialization. Must be overridden.|
2726
|[OnIdle](../mfc/reference/cwinthread-class.md#onidle)|Perform thread-specific idle-time processing. Not usually overridden.|
@@ -46,12 +45,12 @@ MFC provides two versions of `AfxBeginThread` through parameter overloading: one
4645

4746
## What do you want to know more about?
4847

49-
- [Multithreading: Terminating Threads](../parallel/multithreading-terminating-threads.md)
48+
- [Multithreading: Terminating Threads](multithreading-terminating-threads.md)
5049

51-
- [Multithreading: Creating Worker Threads](../parallel/multithreading-creating-worker-threads.md)
50+
- [Multithreading: Creating Worker Threads](multithreading-creating-worker-threads.md)
5251

53-
- [Processes and Threads](http://msdn.microsoft.com/library/windows/desktop/ms684841)
52+
- [Processes and Threads](/windows/desktop/ProcThread/processes-and-threads)
5453

5554
## See Also
5655

57-
[Multithreading with C++ and MFC](../parallel/multithreading-with-cpp-and-mfc.md)
56+
[Multithreading with C++ and MFC](multithreading-with-cpp-and-mfc.md)

0 commit comments

Comments
 (0)