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

C / C++ / MFC

 
Questionsend number to speaker Pin
SYS-MAN16-Jun-07 22:17
SYS-MAN16-Jun-07 22:17 
AnswerRe: send number to speaker Pin
azonenberg17-Jun-07 7:54
azonenberg17-Jun-07 7:54 
QuestionThreads and mutexes Pin
Cyrilix16-Jun-07 21:43
Cyrilix16-Jun-07 21:43 
AnswerRe: Threads and mutexes Pin
Matthew Faithfull17-Jun-07 0:45
Matthew Faithfull17-Jun-07 0:45 
GeneralRe: Threads and mutexes Pin
Cyrilix17-Jun-07 7:02
Cyrilix17-Jun-07 7:02 
GeneralRe: Threads and mutexes Pin
Matthew Faithfull17-Jun-07 10:11
Matthew Faithfull17-Jun-07 10:11 
GeneralRe: Threads and mutexes [modified] Pin
Cyrilix17-Jun-07 11:25
Cyrilix17-Jun-07 11:25 
GeneralRe: Threads and mutexes Pin
Bram van Kampen17-Jun-07 15:00
Bram van Kampen17-Jun-07 15:00 
Acccording to the Microsoft Specification, WaitForSingleObject releases all threads simultaneously when the object waited for is released. If this happens on a network, each machine continues running at it's own speed, running the Remaining threads.

On a Network, All threads will be released simultaneously.

On a Single Machine, All threads will also be released simultaneously, but there is then a Scheduler which will allocate Time Slices. It can only release one thread at the time, and there is no saying to which thread it
will be.

I Think you should re-think your design, but if wakening up to order is
important I suggest that you should have More 'WaitForSingleObject'
calls to Implement your ideas
The Bottom Line is: There is NO guarantee about any following order of re-awakening threads by the operating system!! AND THAT IS GOOD

If this happens on a single machine, there is No Way of predicting which will happen first. At Any Rate if you execute a WaitForSingleObject, your thread waits,and potentially NOTHING you acquired before that call is still usefull.
Keep in mind that in theory, WaitForSingleObject() can wait for years!!
So, When it wakes up, it is important that it is followed by code which re-establishes por Updates what happened before the call, and re-establish the situation, before taking action.

LateNightsInNewry

GeneralRe: Threads and mutexes [modified] Pin
Cyrilix17-Jun-07 16:12
Cyrilix17-Jun-07 16:12 
GeneralRe: Threads and mutexes Pin
Matthew Faithfull17-Jun-07 22:23
Matthew Faithfull17-Jun-07 22:23 
GeneralRe: Threads and mutexes Pin
Bram van Kampen18-Jun-07 13:30
Bram van Kampen18-Jun-07 13:30 
NewsAboubt Barcode printing, VC++ master-hand Come in and help me. Pin
h_boy200816-Jun-07 20:46
h_boy200816-Jun-07 20:46 
AnswerRe: Aboubt Barcode printing, VC++ master-hand Come in and help me. Pin
Matthew Faithfull17-Jun-07 0:38
Matthew Faithfull17-Jun-07 0:38 
GeneralRe: Aboubt Barcode printing, VC++ master-hand Come in and help me. Pin
Matthew Faithfull18-Jun-07 1:44
Matthew Faithfull18-Jun-07 1:44 
Questionmsi setup project Pin
deeps_cute16-Jun-07 20:25
deeps_cute16-Jun-07 20:25 
QuestionFirst-chance exception ... access violation ... pointer issue Pin
moonraker92816-Jun-07 20:18
moonraker92816-Jun-07 20:18 
AnswerRe: First-chance exception ... access violation ... pointer issue Pin
Hans Dietrich16-Jun-07 20:33
mentorHans Dietrich16-Jun-07 20:33 
GeneralRe: First-chance exception ... access violation ... pointer issue Pin
moonraker92816-Jun-07 21:48
moonraker92816-Jun-07 21:48 
GeneralRe: First-chance exception ... access violation ... pointer issue Pin
Bram van Kampen18-Jun-07 13:38
Bram van Kampen18-Jun-07 13:38 
AnswerRe: First-chance exception ... access violation ... pointer issue Pin
Stephen Hewitt17-Jun-07 12:51
Stephen Hewitt17-Jun-07 12:51 
GeneralRe: First-chance exception ... access violation ... pointer issue Pin
Bram van Kampen18-Jun-07 13:49
Bram van Kampen18-Jun-07 13:49 
Questiondrawing 2D in C++ Pin
moonraker92816-Jun-07 19:33
moonraker92816-Jun-07 19:33 
AnswerRe: drawing 2D in C++ Pin
Cyrilix16-Jun-07 21:41
Cyrilix16-Jun-07 21:41 
GeneralRe: drawing 2D in C++ Pin
moonraker92816-Jun-07 22:01
moonraker92816-Jun-07 22:01 
GeneralRe: drawing 2D in C++ Pin
moonraker92816-Jun-07 22:51
moonraker92816-Jun-07 22:51 

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.