Click here to Skip to main content
15,921,660 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralWYSISWYG HTML View Pin
Matt Newman10-Jan-02 11:29
Matt Newman10-Jan-02 11:29 
GeneralRe: WYSISWYG HTML View Pin
alex.barylski10-Jan-02 13:17
alex.barylski10-Jan-02 13:17 
GeneralRe: WYSISWYG HTML View Pin
James R. Twine11-Jan-02 6:13
James R. Twine11-Jan-02 6:13 
GeneralRe: WYSISWYG HTML View Pin
Matt Newman11-Jan-02 15:14
Matt Newman11-Jan-02 15:14 
GeneralRe: WYSISWYG HTML View Pin
James R. Twine11-Jan-02 18:56
James R. Twine11-Jan-02 18:56 
GeneralRe: WYSISWYG HTML View Pin
Matt Newman12-Jan-02 4:59
Matt Newman12-Jan-02 4:59 
GeneralMultithreading and the AfxBeginThread(..) func Pin
Rickard Andersson2010-Jan-02 10:36
Rickard Andersson2010-Jan-02 10:36 
GeneralRe: Multithreading and the AfxBeginThread(..) func Pin
Joaquín M López Muñoz10-Jan-02 11:00
Joaquín M López Muñoz10-Jan-02 11:00 
Well, a thread is like a microprogram that runs separately from the main thread (though accessing the same global variables). From the point of view of Afunction, AfxBeginThread(ThreadFunc, ...) starts another thread and returns immediately (i.e. whitout waiting for ThreadFunc to complete), going then to RasDial. So, from the user's (and the programmer's) perspective both routines (TreadFunc and RasDial) are executed in parallel --that's the whole point of multithreading.
The issue of different threads accessing global variables simultaneously can cause a lot of problems that you must work hard in order to prevent. When programming in a single-threaded environment, you implicitly assume that your variables remain unchanged while you're not dealing whith them --now this is no longer true, and a rich theory about simultaneous access to shared resources has been devised to help you design error-free multithreaded programs. This theory includes concepts as synchronization (waiting for completion of another thread's piece of code), exclusive access (methods to reclaim and grant access to some resource to one thread at a time) and more.
You can find several tutorials about multithreading on the net, just spend some minutes with your search engine to locate lots of them. The concepts underlying multithreading are rather platform-independent, so a good tutorial on multithreading in, say, Java will be worth reading tough you're targeting MFC. As a starting point, here's MSDN article Multithreading Tasks.



Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralRe: Multithreading and the AfxBeginThread(..) func Pin
Rickard Andersson2010-Jan-02 11:42
Rickard Andersson2010-Jan-02 11:42 
GeneralRe: Multithreading and the AfxBeginThread(..) func Pin
Nish Nishant10-Jan-02 16:24
sitebuilderNish Nishant10-Jan-02 16:24 
GeneralRe: Multithreading and the AfxBeginThread(..) func Pin
Rickard Andersson2010-Jan-02 20:53
Rickard Andersson2010-Jan-02 20:53 
Generalwierd debug / release error... Pin
l a u r e n10-Jan-02 9:22
l a u r e n10-Jan-02 9:22 
GeneralRe: wierd debug / release error... Pin
Joaquín M López Muñoz10-Jan-02 9:26
Joaquín M López Muñoz10-Jan-02 9:26 
GeneralRe: wierd debug / release error... Pin
l a u r e n10-Jan-02 9:30
l a u r e n10-Jan-02 9:30 
GeneralRe: wierd debug / release error... Pin
Joaquín M López Muñoz10-Jan-02 9:41
Joaquín M López Muñoz10-Jan-02 9:41 
GeneralRe: wierd debug / release error... Pin
l a u r e n10-Jan-02 9:46
l a u r e n10-Jan-02 9:46 
GeneralRe: wierd debug / release error... Pin
Ernest Laurentin10-Jan-02 10:49
Ernest Laurentin10-Jan-02 10:49 
GeneralRe: wierd debug / release error... Pin
Tim Smith10-Jan-02 9:57
Tim Smith10-Jan-02 9:57 
GeneralRe: wierd debug / release error... Pin
l a u r e n10-Jan-02 9:58
l a u r e n10-Jan-02 9:58 
GeneralRe: wierd debug / release error... Pin
Joaquín M López Muñoz10-Jan-02 10:08
Joaquín M López Muñoz10-Jan-02 10:08 
GeneralRe: wierd debug / release error... Pin
l a u r e n10-Jan-02 10:55
l a u r e n10-Jan-02 10:55 
GeneralRe: wierd debug / release error... Pin
Joaquín M López Muñoz10-Jan-02 11:13
Joaquín M López Muñoz10-Jan-02 11:13 
GeneralRe: wierd debug / release error... Pin
Michael Dunn10-Jan-02 13:06
sitebuilderMichael Dunn10-Jan-02 13:06 
GeneralEnumWindows and EnumWindowsProc Pin
RobJones10-Jan-02 9:08
RobJones10-Jan-02 9:08 
GeneralRe: EnumWindows and EnumWindowsProc Pin
Joaquín M López Muñoz10-Jan-02 9:36
Joaquín M López Muñoz10-Jan-02 9:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.