Board index » cppbuilder » wonderful Threads

wonderful Threads


2004-05-20 05:31:47 PM
cppbuilder4
Hi all,
Question 1. If i have a vector holding a bunch pointers of threads, do i
need to synchronize or lock before reading a value of a thread from the
vector? e.g. myvec[i]->GetThreadVal(); It seems to work fine, but i'm not
sure if its part or total cause to Question 2 below.
Question 2: I am finding that when i open 15 or more threads, and minimize
the app, on maximize the application soaks up all the cpu. Not sure if this
is thrashing - can i tell from looking at the page faults? How is it
possible to cure this? Thread pool perhaps?
Any suggestions more than welcome.
Thanks in advance, Angus.
 
 

Re:wonderful Threads

So, for those that may have a similar problem in the future - a partial
solution.
Page faults may be a red-herring - debug to find what chunk of code causes
the trashing - for me it was a windows enumerator inside the tread - why i
wonder should this gobble up cpu time when being maximized - i may never
know - howerver, synchronizing the method made it do a Hudini. Finding the
reason for this problem is probably beyond my scope {} - but common sense
says - a slower less efficient program will always, always always be better
than one that crashes.
Angus.
"Angus" < XXXX@XXXXX.COM >wrote in message
Quote
Hi all,

Question 1. If i have a vector holding a bunch pointers of threads, do i
need to synchronize or lock before reading a value of a thread from the
vector? e.g. myvec[i]->GetThreadVal(); It seems to work fine, but i'm not
sure if its part or total cause to Question 2 below.

Question 2: I am finding that when i open 15 or more threads, and minimize
the app, on maximize the application soaks up all the cpu. Not sure if
this
is thrashing - can i tell from looking at the page faults? How is it
possible to cure this? Thread pool perhaps?

Any suggestions more than welcome.

Thanks in advance, Angus.