Click here to Skip to main content
15,913,089 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
How long are the threads processing for before they're terminating? If it's less than a second you're not going to get a big speedup. That's life unfortunately!

There are all sorts of things that can slow processing of threads down:

- the most common one is not partitioning the data properly so you've got complex synchronisation objects involved. It takes time to lock a mutex or raise a semaphore

- you're blowing the shared L2 cache. Either the data working set is too big to fit in the cache so all your threads slow down as they're punting each other's data out OR there's no locality of reference in the data structures you're using. For example sharing a map between threads can be eyewateringly slow compared to sharing a vector. You could try compiling for size and see if that affects the number of cache misses (faster code is usually bigger so less of it fits in the processor cache)

- it just takes time to start up a thread. Somewhere between 10ms and 100ms depending on your system

Anyway the upshot of this is it's a bit hard to work out what's wrong without seeing some code and then most of the people on here probably couldn't make very good guesses as to what's wrong (me included). The other moral of this story is to only start multiple threads when you've got something specific for them to do that's going to slow down the responsiveness of your application if you do it on your main thread.

Cheers,

Ash
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 
QuestionRe: ListCtrl SetItemText Pin
CPallini25-May-10 0:53
mveCPallini25-May-10 0:53 
AnswerRe: ListCtrl SetItemText Pin
Sakhalean25-May-10 1:01
Sakhalean25-May-10 1:01 
AnswerRe: ListCtrl SetItemText Pin
Sakhalean25-May-10 1:42
Sakhalean25-May-10 1:42 
GeneralRe: ListCtrl SetItemText Pin
CPallini25-May-10 1:44
mveCPallini25-May-10 1:44 

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.