Click here to Skip to main content
15,910,234 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSemaphore Max count. Pin
_80865-May-09 6:57
_80865-May-09 6:57 
AnswerRe: Semaphore Max count. Pin
Stuart Dootson5-May-09 7:26
professionalStuart Dootson5-May-09 7:26 
GeneralRe: Semaphore Max count. Pin
_80865-May-09 16:36
_80865-May-09 16:36 
GeneralRe: Semaphore Max count. Pin
Stuart Dootson5-May-09 17:00
professionalStuart Dootson5-May-09 17:00 
GeneralRe: Semaphore Max count. Pin
_80865-May-09 17:20
_80865-May-09 17:20 
GeneralRe: Semaphore Max count. Pin
_80866-May-09 6:36
_80866-May-09 6:36 
GeneralRe: Semaphore Max count. Pin
Stuart Dootson6-May-09 7:24
professionalStuart Dootson6-May-09 7:24 
GeneralRe: Semaphore Max count. Pin
_80866-May-09 16:23
_80866-May-09 16:23 
Stuart Dootson wrote:
Ummm - it'd create a new semaphore? Or are you creating a named semaphore and using the same name as previously (and if that's the case, the initial and maximum counts are ignored)?


Yes I've been talking about named semaphores across multiple processes Smile | :) . Also why it init, max counts should be ignored in this case?

Stuart Dootson wrote:
If you use WaitForSingleObject, it will return WAIT_OBJECT_0 if it acquires the semaphore or WAIT_TIMEOUT if the semaphore isn't available (unless you specify a timeout of INFINITE, in which case WaitForSingleObject will never return).


Hmm okay now it's clear. I did have a wrong idea. For example, If the initial count = 3, maxcount =5. I thought 3 would get WAIT_OBJECT_ thing, the next 2 Would calls would "successfully-get-blocked" with the wait function. Any other calls after these wouldn't wait successfully. I thought this will also get through the wait function but with some error set in "last-error".

----------------------------
286? WOWW!Blush | :O

GeneralRe: Semaphore Max count. Pin
Stuart Dootson6-May-09 19:32
professionalStuart Dootson6-May-09 19:32 
QuestionHelp about Win32 Message loop Pin
reply2am5-May-09 4:48
reply2am5-May-09 4:48 
QuestionAnimatedGif drawing with openGL Pin
Jufranz5-May-09 4:10
Jufranz5-May-09 4:10 
QuestionHow to Convert _asm to Interinsics Pin
AB_dev5-May-09 3:32
AB_dev5-May-09 3:32 
AnswerRe: How to Convert _asm to Interinsics Pin
Stuart Dootson5-May-09 3:42
professionalStuart Dootson5-May-09 3:42 
GeneralRe: How to Convert _asm to Interinsics Pin
AB_dev5-May-09 3:47
AB_dev5-May-09 3:47 
GeneralRe: How to Convert _asm to Interinsics Pin
harold aptroot5-May-09 4:02
harold aptroot5-May-09 4:02 
GeneralRe: How to Convert _asm to Interinsics Pin
Stuart Dootson5-May-09 4:03
professionalStuart Dootson5-May-09 4:03 
AnswerRe: How to Convert _asm to Interinsics Pin
Randor 5-May-09 7:45
professional Randor 5-May-09 7:45 
QuestionHow to add web reference in my C++ project? Pin
eight5-May-09 3:29
eight5-May-09 3:29 
AnswerRe: How to add web reference in my C++ project? Pin
Stuart Dootson5-May-09 3:35
professionalStuart Dootson5-May-09 3:35 
GeneralRe: How to add web reference in my C++ project? Pin
eight5-May-09 16:16
eight5-May-09 16:16 
GeneralRe: How to add web reference in my C++ project? Pin
Stuart Dootson5-May-09 16:51
professionalStuart Dootson5-May-09 16:51 
GeneralRe: How to add web reference in my C++ project? Pin
Member 22503526-Mar-11 20:14
Member 22503526-Mar-11 20:14 
QuestionSync problem when call ControlService with SERVICE_CONTROL_PARAMCHANGE Pin
maishuiking5-May-09 2:38
maishuiking5-May-09 2:38 
AnswerRe: Sync problem when call ControlService with SERVICE_CONTROL_PARAMCHANGE Pin
Stuart Dootson5-May-09 3:31
professionalStuart Dootson5-May-09 3:31 
Questionchanging the mouse cursor when moved Pin
brucewayn5-May-09 1:50
brucewayn5-May-09 1:50 

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.