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

C / C++ / MFC

 
GeneralRe: Application.DoEvents () = WIN32 API ? Pin
kakan17-Apr-07 23:49
professionalkakan17-Apr-07 23:49 
GeneralRe: Application.DoEvents () = WIN32 API ? Pin
amitmistry_petlad 17-Apr-07 23:50
amitmistry_petlad 17-Apr-07 23:50 
GeneralRe: Application.DoEvents () = WIN32 API ? Pin
kakan18-Apr-07 0:32
professionalkakan18-Apr-07 0:32 
GeneralRe: Application.DoEvents () = WIN32 API ? Pin
amitmistry_petlad 18-Apr-07 1:01
amitmistry_petlad 18-Apr-07 1:01 
GeneralRe: Application.DoEvents () = WIN32 API ? Pin
kakan18-Apr-07 1:15
professionalkakan18-Apr-07 1:15 
GeneralRe: Application.DoEvents () = WIN32 API ? Pin
amitmistry_petlad 18-Apr-07 1:21
amitmistry_petlad 18-Apr-07 1:21 
QuestionCSemaphore Question Pin
softwaremonkey17-Apr-07 20:57
softwaremonkey17-Apr-07 20:57 
AnswerRe: CSemaphore Question Pin
Roger Stoltz17-Apr-07 21:30
Roger Stoltz17-Apr-07 21:30 
softwaremonkey wrote:
If CSemaphore::Release() is called multiple times by the same thread, does it increase the count each time


Yes, absolutely.
Unless there's something wrong with the CSemaphore class since a semaphore is supposed to work that way.


softwaremonkey wrote:
I am working on some code where one thread calls Release() each time it adds stuff to a queue, expecting a worker thread to fire the correct number of times to remove stuff from the queue. The code doesnt work properly and I suspect it is fundamentally flawed.


This is a commonly used technique that is both efficient and a school book example of good asynchronous design. About the "fundamentally flawed" part I can assure you that it's not, at least not in the aspect of design.
However, I don't use the CSemaphore class. I favour to use ::CreateSemaphore(...), ::ReleaseSemaphore(...) and ::CloseHandle(...).

Can you explain more about the code where you push and pop your object to the queue and how you wait on the semaphore? How about some small code snippets, preferrably within <pre> tags...
You can also read about it here[^].


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown

AnswerRe: CSemaphore Question Pin
Mark Salsbery18-Apr-07 6:58
Mark Salsbery18-Apr-07 6:58 
GeneralRe: CSemaphore Question Pin
softwaremonkey18-Apr-07 7:58
softwaremonkey18-Apr-07 7:58 
GeneralRe: CSemaphore Question Pin
Roger Stoltz18-Apr-07 9:02
Roger Stoltz18-Apr-07 9:02 
GeneralRe: CSemaphore Question Pin
softwaremonkey18-Apr-07 12:52
softwaremonkey18-Apr-07 12:52 
GeneralRe: CSemaphore Question Pin
Roger Stoltz18-Apr-07 23:00
Roger Stoltz18-Apr-07 23:00 
QuestionCopying HTML page along with the images from it. [modified] Pin
Sameer_Thakur17-Apr-07 20:46
Sameer_Thakur17-Apr-07 20:46 
AnswerRe: Copying HTML page along with the images from it. Pin
Hamid_RT17-Apr-07 21:38
Hamid_RT17-Apr-07 21:38 
QuestionRetreiving content from textbox???? Pin
ashokbngr17-Apr-07 20:26
ashokbngr17-Apr-07 20:26 
AnswerRe: Retreiving content from textbox???? Pin
Programm3r17-Apr-07 20:31
Programm3r17-Apr-07 20:31 
AnswerRe: Retreiving content from textbox???? Pin
Hamid_RT17-Apr-07 21:15
Hamid_RT17-Apr-07 21:15 
QuestionSuppressing the "Missing Picture Dialog - Warning Message " Pin
sivakarthick17-Apr-07 20:23
sivakarthick17-Apr-07 20:23 
QuestionWindows Socket Link error Pin
Syamlal S Nair17-Apr-07 20:16
Syamlal S Nair17-Apr-07 20:16 
AnswerRe: Windows Socket Link error Pin
Programm3r17-Apr-07 20:20
Programm3r17-Apr-07 20:20 
GeneralRe: Windows Socket Link error Pin
Syamlal S Nair17-Apr-07 20:26
Syamlal S Nair17-Apr-07 20:26 
GeneralRe: Windows Socket Link error Pin
Programm3r17-Apr-07 20:30
Programm3r17-Apr-07 20:30 
AnswerRe: Windows Socket Link error Pin
Paresh Chitte17-Apr-07 20:20
Paresh Chitte17-Apr-07 20:20 
AnswerRe: Windows Socket Link error Pin
prasad_som17-Apr-07 20:21
prasad_som17-Apr-07 20:21 

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.