Click here to Skip to main content
15,894,646 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: C programming question Pin
Richard MacCutchan6-Jul-12 21:09
mveRichard MacCutchan6-Jul-12 21:09 
AnswerRe: C programming question Pin
Code-o-mat6-Jul-12 22:45
Code-o-mat6-Jul-12 22:45 
GeneralRe: C programming question Pin
Richard MacCutchan7-Jul-12 0:48
mveRichard MacCutchan7-Jul-12 0:48 
GeneralRe: C programming question Pin
Code-o-mat7-Jul-12 9:04
Code-o-mat7-Jul-12 9:04 
GeneralRe: C programming question Pin
Richard Andrew x647-Jul-12 10:55
professionalRichard Andrew x647-Jul-12 10:55 
GeneralRe: C programming question Pin
BCN-1637-Jul-12 16:24
BCN-1637-Jul-12 16:24 
GeneralRe: C programming question Pin
Code-o-mat7-Jul-12 23:20
Code-o-mat7-Jul-12 23:20 
AnswerRe: C programming question Pin
CPallini8-Jul-12 9:45
mveCPallini8-Jul-12 9:45 
JokeRe: C programming question Pin
Albert Holguin8-Jul-12 17:12
professionalAlbert Holguin8-Jul-12 17:12 
QuestionSocket connection problem Pin
ForNow6-Jul-12 3:08
ForNow6-Jul-12 3:08 
AnswerRe: Socket connection problem Pin
Albert Holguin6-Jul-12 4:15
professionalAlbert Holguin6-Jul-12 4:15 
GeneralRe: Socket connection problem Pin
ForNow6-Jul-12 6:57
ForNow6-Jul-12 6:57 
AnswerRe: Socket connection problem Pin
fat_boy6-Jul-12 5:53
fat_boy6-Jul-12 5:53 
QuestionReading Buffer of unicode and ansi character Pin
john56326-Jul-12 0:06
john56326-Jul-12 0:06 
GeneralRe: Reading Buffer of unicode and ansi character Pin
Jochen Arndt6-Jul-12 0:22
professionalJochen Arndt6-Jul-12 0:22 
GeneralRe: Reading Buffer of unicode and ansi character Pin
john56326-Jul-12 0:39
john56326-Jul-12 0:39 
AnswerRe: Reading Buffer of unicode and ansi character Pin
Jochen Arndt6-Jul-12 0:56
professionalJochen Arndt6-Jul-12 0:56 
GeneralRe: Reading Buffer of unicode and ansi character Pin
john56326-Jul-12 1:09
john56326-Jul-12 1:09 
GeneralRe: Reading Buffer of unicode and ansi character Pin
Jochen Arndt6-Jul-12 1:18
professionalJochen Arndt6-Jul-12 1:18 
GeneralRe: Reading Buffer of unicode and ansi character Pin
john56326-Jul-12 1:31
john56326-Jul-12 1:31 
GeneralRe: Reading Buffer of unicode and ansi character Pin
Jochen Arndt6-Jul-12 1:52
professionalJochen Arndt6-Jul-12 1:52 
GeneralRe: Reading Buffer of unicode and ansi character Pin
BCN-1637-Jul-12 16:32
BCN-1637-Jul-12 16:32 
GeneralRe: Reading Buffer of unicode and ansi character Pin
Jochen Arndt7-Jul-12 22:28
professionalJochen Arndt7-Jul-12 22:28 
GeneralRe: Reading Buffer of unicode and ansi character Pin
BCN-1638-Jul-12 2:36
BCN-1638-Jul-12 2:36 
QuestionProgramming Problem Pin
Ahmed Charfeddine5-Jul-12 22:54
Ahmed Charfeddine5-Jul-12 22:54 
We have a collection of items C(x)
A thread A is responsible for performing tasks for those items in a continous and circular way.
In coding terms, we would write :

void doWork() // function executed by thread A
{
	while(true)
	{
		for each x in C(x)
			perform task(x).
	}
}


We have other threads, that write and remove items from C(x) :
void remove(x);
void Add(x);


Now comes the final specification :

The function task(x), returns either true or false. If false is returned, then it means, there no need to call task(x) for the same x
in the future, unless some thread makes a signal for us that the thread A should be processing all element x.

let's call this notification function :
void NotifyIncludeAllElements();


What is the best approach here ?
Push Framework - now released !
http://www.pushframework.com

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.