Click here to Skip to main content
16,007,809 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMSDN volatile sample Pin
George_George27-Dec-07 21:51
George_George27-Dec-07 21:51 
GeneralRe: MSDN volatile sample Pin
«_Superman_»27-Dec-07 22:51
professional«_Superman_»27-Dec-07 22:51 
GeneralRe: MSDN volatile sample Pin
George_George27-Dec-07 23:48
George_George27-Dec-07 23:48 
GeneralRe: MSDN volatile sample Pin
Maxwell Chen27-Dec-07 23:01
Maxwell Chen27-Dec-07 23:01 
GeneralRe: MSDN volatile sample Pin
George_George27-Dec-07 23:47
George_George27-Dec-07 23:47 
GeneralRe: MSDN volatile sample Pin
Maxwell Chen28-Dec-07 1:48
Maxwell Chen28-Dec-07 1:48 
GeneralRe: MSDN volatile sample Pin
George_George28-Dec-07 2:09
George_George28-Dec-07 2:09 
GeneralRe: MSDN volatile sample Pin
CPallini28-Dec-07 2:22
mveCPallini28-Dec-07 2:22 
Anything wrong with my previous analysis? Please feel free to correct me.


Yes, you're wrong in the following assumption:
George_George wrote:
Sleep(0) will wait until there is a signal.


because MSDN http://msdn2.microsoft.com/en-us/library/ms686298.aspx[^] states:


Parameters

dwMilliseconds

The minimum time interval for which execution is to be suspended, in milliseconds.

A value of zero causes the thread to relinquish the remainder of its time slice to any other thread of equal priority that is ready to run. If there are no other threads of equal priority ready to run, the function returns immediately, and the thread continues execution.


i.e. Sleeps(0), in absence of signals, doesn't wait forever.
Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

[my articles]


GeneralRe: MSDN volatile sample Pin
George_George28-Dec-07 2:31
George_George28-Dec-07 2:31 
GeneralYes. Pin
CPallini28-Dec-07 2:41
mveCPallini28-Dec-07 2:41 
GeneralRe: Yes. Pin
George_George28-Dec-07 2:57
George_George28-Dec-07 2:57 
GeneralRe: Yes. Pin
CPallini28-Dec-07 3:18
mveCPallini28-Dec-07 3:18 
GeneralRe: Yes. Pin
George_George28-Dec-07 3:26
George_George28-Dec-07 3:26 
GeneralRe: Yes. Pin
CPallini28-Dec-07 3:46
mveCPallini28-Dec-07 3:46 
GeneralRe: Yes. Pin
George_George28-Dec-07 3:53
George_George28-Dec-07 3:53 
GeneralRe: Yes. Pin
CPallini28-Dec-07 4:05
mveCPallini28-Dec-07 4:05 
GeneralRe: Yes. Pin
George_George28-Dec-07 18:18
George_George28-Dec-07 18:18 
GeneralRe: Yes. Pin
CPallini28-Dec-07 22:50
mveCPallini28-Dec-07 22:50 
GeneralRe: Yes. Pin
George_George28-Dec-07 23:08
George_George28-Dec-07 23:08 
GeneralRe: Yes. Pin
CPallini28-Dec-07 23:45
mveCPallini28-Dec-07 23:45 
GeneralRe: Yes. Pin
George_George29-Dec-07 0:00
George_George29-Dec-07 0:00 
GeneralRe: Yes. Pin
Maxwell Chen28-Dec-07 4:25
Maxwell Chen28-Dec-07 4:25 
GeneralRe: Yes. Pin
JudyL_MD28-Dec-07 12:21
JudyL_MD28-Dec-07 12:21 
GeneralRe: Yes. Pin
George_George28-Dec-07 18:17
George_George28-Dec-07 18:17 
GeneralRe: Yes. [modified] Pin
JudyL_MD28-Dec-07 20:01
JudyL_MD28-Dec-07 20:01 

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.