Click here to Skip to main content
15,913,201 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to catch wave API WHDR_DONE flag? SOLVED with timer and while loop Pin
David Crow20-Oct-13 16:02
David Crow20-Oct-13 16:02 
Questionsystem call mknod() failing with errno 2 on ubuntu Pin
SunilKrSingh19-Oct-13 1:04
SunilKrSingh19-Oct-13 1:04 
AnswerRe: system call mknod() failing with errno 2 on ubuntu Pin
Richard MacCutchan19-Oct-13 2:34
mveRichard MacCutchan19-Oct-13 2:34 
NewsBeginning WPF 4.5 by Full Example (EPUB) Pin
Stephen. P .Thomas19-Oct-13 0:09
Stephen. P .Thomas19-Oct-13 0:09 
QuestionWait for event versus while / do loop or timer – academic questions Pin
Vaclav_18-Oct-13 12:55
Vaclav_18-Oct-13 12:55 
AnswerRe: Wait for event versus while / do loop or timer – academic questions Pin
Richard Andrew x6418-Oct-13 13:31
professionalRichard Andrew x6418-Oct-13 13:31 
AnswerRe: Wait for event versus while / do loop or timer – academic questions Pin
digitalspace.xjtu18-Oct-13 16:46
digitalspace.xjtu18-Oct-13 16:46 
AnswerRe: Wait for event versus while / do loop or timer – academic questions Pin
pasztorpisti19-Oct-13 4:30
pasztorpisti19-Oct-13 4:30 
BTW, why do you want to wait on the worker thread? I simply don't understand this. Usually when a worker finishes with something you want to send an event to the "owner" of the worker thread immediately.

do-loop / "spinning" is almost always a bad advice. Spinning is usually acceptable only in the form of a spin lock in some special cases of locking where it can terribly outperform normal locks.

Thread priorities: Don't mess with thread priorities. Especially if your software is crossplatform. The best is to run everything on normal priority in most user space applications. In some cases setting the priority of some background data-loader threads to lower priority can help making the gui interaction smoother (usually if the machine is single-cpu and the IO terribly blocks on the background thread for some reason).

What does the main thread do? Is it prepared for the event? Your job would be pretty easy if the main thread would be a gui thread or some other kind of thread that processes jobs/tasks from a blocking message queue.

Timer??? Why do you need a timer and on which thread? Why don't you want to send the event from the worker thread immediately?
GeneralRe: Wait for event versus while / do loop or timer – academic questions Pin
Vaclav_19-Oct-13 6:29
Vaclav_19-Oct-13 6:29 
GeneralRe: Wait for event versus while / do loop or timer – academic questions Pin
pasztorpisti19-Oct-13 7:22
pasztorpisti19-Oct-13 7:22 
AnswerRe: Wait for event versus while / do loop or timer – academic questions Pin
David Crow19-Oct-13 16:43
David Crow19-Oct-13 16:43 
GeneralRe: Wait for event versus while / do loop or timer – academic questions SOLVED Pin
Vaclav_20-Oct-13 5:33
Vaclav_20-Oct-13 5:33 
Questionrtp server using ffmpeg in VC++ Pin
CodingHell18-Oct-13 2:39
CodingHell18-Oct-13 2:39 
AnswerRe: rtp server using ffmpeg in VC++ Pin
PCuong198322-Oct-13 5:20
professionalPCuong198322-Oct-13 5:20 
GeneralRe: rtp server using ffmpeg in VC++ Pin
CodingHell22-Oct-13 18:45
CodingHell22-Oct-13 18:45 
QuestionCListCtrl subitem text not colored. Pin
Le@rner17-Oct-13 19:27
Le@rner17-Oct-13 19:27 
QuestionRe: CListCtrl subitem text not colored. Pin
David Crow18-Oct-13 4:13
David Crow18-Oct-13 4:13 
AnswerRe: CListCtrl subitem text not colored. Pin
Jochen Arndt18-Oct-13 5:37
professionalJochen Arndt18-Oct-13 5:37 
QuestionHow Draw default button MFC (BS_DEFPUSHBUTTON)? Pin
thanhtuan198917-Oct-13 18:08
thanhtuan198917-Oct-13 18:08 
QuestionWhy a HANDLE created by CreateFile can be assigned to an object Pin
digitalspace.xjtu17-Oct-13 5:07
digitalspace.xjtu17-Oct-13 5:07 
AnswerRe: Why a HANDLE created by CreateFile can be assigned to an object Pin
Albert Holguin17-Oct-13 5:20
professionalAlbert Holguin17-Oct-13 5:20 
GeneralRe: Why a HANDLE created by CreateFile can be assigned to an object Pin
digitalspace.xjtu17-Oct-13 5:33
digitalspace.xjtu17-Oct-13 5:33 
AnswerRe: Why a HANDLE created by CreateFile can be assigned to an object Pin
Chris Losinger17-Oct-13 5:25
professionalChris Losinger17-Oct-13 5:25 
GeneralRe: Why a HANDLE created by CreateFile can be assigned to an object Pin
digitalspace.xjtu17-Oct-13 5:35
digitalspace.xjtu17-Oct-13 5:35 
QuestionHow to generate DSA 512 bit KeyPair in VC++ 2010 Pin
IICTECH17-Oct-13 3:05
IICTECH17-Oct-13 3:05 

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.