Click here to Skip to main content
15,887,344 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to Convert from console application with .C files to MFC based application Pin
Rajesh R Subramanian2-May-10 22:57
professionalRajesh R Subramanian2-May-10 22:57 
GeneralRe: How to Convert from console application with .C files to MFC based application Pin
CPallini3-May-10 21:19
mveCPallini3-May-10 21:19 
GeneralRe: How to Convert from console application with .C files to MFC based application Pin
Rajesh R Subramanian3-May-10 22:31
professionalRajesh R Subramanian3-May-10 22:31 
QuestionWin32 / C++ Pin
Fareed Rizkalla2-May-10 10:33
Fareed Rizkalla2-May-10 10:33 
AnswerRe: Win32 / C++ Pin
Code-o-mat2-May-10 10:48
Code-o-mat2-May-10 10:48 
AnswerRe: Win32 / C++ Pin
Michel Godfroid2-May-10 10:51
Michel Godfroid2-May-10 10:51 
AnswerRe: Win32 / C++ Pin
ThatsAlok2-May-10 20:04
ThatsAlok2-May-10 20:04 
QuestionMultithreading in general Pin
csrss2-May-10 9:22
csrss2-May-10 9:22 
So, here is the thing:

for example i got a function which reads a file line by line and outputs each line to a console.
My file got 10 lines of text. Now i want to implement multithreading. i can use, for example,

int total_nr_of_threads = 7;

create max up to 7 threads and each thread will be responsible for reading some line from text file starting from the very 1st line and outputs data. And then for example when 1st thread finishes, it checks which line hasnt been read and read it and then outputs data. So how can i implement this? How to check if some line has been already read by some thread and another thread will not read it again?
I'm confused about the algorithm, just got stuck with it D'Oh! | :doh:

Thanks in advance.
AnswerRe: Multithreading in general Pin
CPallini2-May-10 9:39
mveCPallini2-May-10 9:39 
AnswerRe: Multithreading in general Pin
csrss2-May-10 9:56
csrss2-May-10 9:56 
GeneralRe: Multithreading in general Pin
Software_Developer3-May-10 2:46
Software_Developer3-May-10 2:46 
AnswerRe: Multithreading in general Pin
ThatsAlok2-May-10 20:01
ThatsAlok2-May-10 20:01 
AnswerRe: Multithreading in general Pin
Rajesh R Subramanian2-May-10 23:02
professionalRajesh R Subramanian2-May-10 23:02 
AnswerRe: Multithreading in general Pin
Emilio Garavaglia3-May-10 1:23
Emilio Garavaglia3-May-10 1:23 
GeneralRe: And he would be violating the rules of threading. Pin
Software_Developer3-May-10 2:59
Software_Developer3-May-10 2:59 
GeneralRe: And he would be violating the rules of threading. Pin
Emilio Garavaglia25-Jun-10 3:04
Emilio Garavaglia25-Jun-10 3:04 
QuestionHow could I route all the windows messages of a dialog to a thread with their parameters? Pin
m_code2-May-10 8:43
m_code2-May-10 8:43 
AnswerRe: How could I route all the windows messages of a dialog to a thread with their parameters? Pin
Richard Andrew x642-May-10 8:53
professionalRichard Andrew x642-May-10 8:53 
AnswerRe: How could I route all the windows messages of a dialog to a thread with their parameters? Pin
Michel Godfroid2-May-10 8:58
Michel Godfroid2-May-10 8:58 
GeneralRe: How could I route all the windows messages of a dialog to a thread with their parameters? Pin
m_code2-May-10 9:07
m_code2-May-10 9:07 
GeneralRe: How could I route all the windows messages of a dialog to a thread with their parameters? Pin
Michel Godfroid2-May-10 9:22
Michel Godfroid2-May-10 9:22 
GeneralRe: How could I route all the windows messages of a dialog to a thread with their parameters? Pin
m_code2-May-10 9:57
m_code2-May-10 9:57 
GeneralRe: Sample code, the good way Pin
Software_Developer2-May-10 19:08
Software_Developer2-May-10 19:08 
GeneralRe: Sample code, the good way Pin
Randor 3-May-10 6:22
professional Randor 3-May-10 6:22 
GeneralRe: SendMessage is thread-safe because no interaction between the threads Pin
Software_Developer3-May-10 20:01
Software_Developer3-May-10 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.