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

C / C++ / MFC

 
AnswerRe: matrix class Pin
asadullah ansari25-May-10 16:31
asadullah ansari25-May-10 16:31 
QuestionWiX: Any good books or courses? Pin
Leif Goodwin25-May-10 5:51
Leif Goodwin25-May-10 5:51 
QuestionResizable controls Pin
Sakhalean25-May-10 5:14
Sakhalean25-May-10 5:14 
AnswerRe: Resizable controls Pin
Richard MacCutchan25-May-10 5:32
mveRichard MacCutchan25-May-10 5:32 
AnswerRe: Resizable controls Pin
David Crow25-May-10 7:23
David Crow25-May-10 7:23 
AnswerRe: Resizable controls Pin
wangningyu25-May-10 18:08
wangningyu25-May-10 18:08 
GeneralRe: Resizable controls Pin
Sakhalean25-May-10 18:46
Sakhalean25-May-10 18:46 
Questionshort and long worker thread VS sincronization and global efficiency Pin
Russell'25-May-10 4:44
Russell'25-May-10 4:44 
I have a long routine that I'm thinking to modify splitting it in different parallel worker-thread. This to try to reach 100% on multicore CPU and let the time required be less.

Now when I start the worker-threads (say 3-5) the main-thread have to (simply) wait that the other worker-threads ends. Then it have to repeat this stage for many iterations.

A simple solution I found is to start in the main-thread a loop that do a simple Sleep (for some ms) and then checks some flags that the worker-threads sets when ending. When it understand that all the threads are end it make some computations and start all again.

What I test is that for long worker-thread it seems to work (CPU reaches 100%), but when the worker-thread are very shorts (some ms) it looks that the CPU doesn't reach high values.
I think because the time spent into the sleep function is too much in comparison with the time required from the worker thread.

Because the time required from the worker-thread depends on a complex combination of the input parameters and I can't estimate at the beginning then I tried to start with a sleepTime = 2m (very low!) increasing it after every loop of the main-thread. But again the CPU in case of short processing looks to low.

Any suggestion? Diffent approaches?

Russell

AnswerRe: short and long worker thread VS sincronization and global efficiency Pin
Russell'25-May-10 4:49
Russell'25-May-10 4:49 
AnswerRe: short and long worker thread VS sincronization and global efficiency Pin
Aescleal25-May-10 4:52
Aescleal25-May-10 4:52 
GeneralRe: short and long worker thread VS sincronization and global efficiency Pin
Russell'25-May-10 5:59
Russell'25-May-10 5:59 
GeneralRe: short and long worker thread VS sincronization and global efficiency Pin
Aescleal25-May-10 8:26
Aescleal25-May-10 8:26 
GeneralRe: short and long worker thread VS sincronization and global efficiency Pin
Russell'25-May-10 21:33
Russell'25-May-10 21:33 
AnswerRe: short and long worker thread VS sincronization and global efficiency Pin
David Crow25-May-10 7:26
David Crow25-May-10 7:26 
Questionabout Memory-Mapped Files do with the big file. Pin
lxlenovostar25-May-10 3:23
lxlenovostar25-May-10 3:23 
AnswerRe: about Memory-Mapped Files do with the big file. [modified] Pin
«_Superman_»25-May-10 5:44
professional«_Superman_»25-May-10 5:44 
Question"Launch Now" is not working Pin
rahul.kulshreshtha25-May-10 1:10
rahul.kulshreshtha25-May-10 1:10 
AnswerRe: "Launch Now" is not working Pin
ThatsAlok25-May-10 1:51
ThatsAlok25-May-10 1:51 
GeneralRe: "Launch Now" is not working Pin
rahul.kulshreshtha25-May-10 2:46
rahul.kulshreshtha25-May-10 2:46 
AnswerRe: "Launch Now" is not working Pin
Aescleal25-May-10 2:58
Aescleal25-May-10 2:58 
GeneralRe: "Launch Now" is not working Pin
rahul.kulshreshtha25-May-10 3:45
rahul.kulshreshtha25-May-10 3:45 
QuestionRe: "Launch Now" is not working [modified] Pin
rahul.kulshreshtha25-May-10 21:10
rahul.kulshreshtha25-May-10 21:10 
QuestionListCtrl SetItemText Pin
Sakhalean25-May-10 0:07
Sakhalean25-May-10 0:07 
QuestionRe: ListCtrl SetItemText Pin
CPallini25-May-10 0:41
mveCPallini25-May-10 0:41 
AnswerRe: ListCtrl SetItemText Pin
Sakhalean25-May-10 0:46
Sakhalean25-May-10 0:46 

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.