R
raican
I've written a module for a larger project which can dynamically
created and free up to 16 threads and has an extra thread which watches
the treads to see when they terminate (this runs always, and cannot be
paused). all this works superbly!
then i added pause (suspend) and resume functionality, and this works
for the most part...
having all 17 threads running (16 dynamic and 1 watcher) the cpu usage
runs happily around 0-4% to 10-12%. when they are all paused, cpu usage
is around the same. then when they are all resumed, cpu usage again
remains the same. when individual threads are paused and resumed, the
cpu is quite happy.
then the problems arise. if you have any number of paused threads, and
then create a new thread, the cpu usage jumps to 100%.
needless to say my processor fan goes in to overdrive, and sounds like
a jet engine.
even when the newest thread terminates, the cpu stays at 100%. the cpu
only returns to normal if all the paused threads are resumed, or if
they are all freed.
i am pretty confident it is not the watcher thread, as i have disabled
it in code, and the cpu still goes crazy. i also don't believe it is
the dynamic threads, as, like i said earlier, the cpu stays at 100%
even when the new thread terminates.
Any ideas? Any Clues?
Could it be on of the other threads in the program, i.e. forms?
could it be on of the paused dynamic threads?
could it be another process entirely?
Arrrgggghhhhh!!!!!!
Is there anyway to monitor the threads, and see which one is eating the
cpu time.
I've tried the Process Class with Process.GetProcesses() and
Process.Threads, but all i can get is the Thread IDs not the Names, so
i don't know which is which...
Help me Obi Wan... I've been at this three days, and i only had 4 hours
sleep last night.
Thx All.
created and free up to 16 threads and has an extra thread which watches
the treads to see when they terminate (this runs always, and cannot be
paused). all this works superbly!
then i added pause (suspend) and resume functionality, and this works
for the most part...
having all 17 threads running (16 dynamic and 1 watcher) the cpu usage
runs happily around 0-4% to 10-12%. when they are all paused, cpu usage
is around the same. then when they are all resumed, cpu usage again
remains the same. when individual threads are paused and resumed, the
cpu is quite happy.
then the problems arise. if you have any number of paused threads, and
then create a new thread, the cpu usage jumps to 100%.
needless to say my processor fan goes in to overdrive, and sounds like
a jet engine.
even when the newest thread terminates, the cpu stays at 100%. the cpu
only returns to normal if all the paused threads are resumed, or if
they are all freed.
i am pretty confident it is not the watcher thread, as i have disabled
it in code, and the cpu still goes crazy. i also don't believe it is
the dynamic threads, as, like i said earlier, the cpu stays at 100%
even when the new thread terminates.
Any ideas? Any Clues?
Could it be on of the other threads in the program, i.e. forms?
could it be on of the paused dynamic threads?
could it be another process entirely?
Arrrgggghhhhh!!!!!!
Is there anyway to monitor the threads, and see which one is eating the
cpu time.
I've tried the Process Class with Process.GetProcesses() and
Process.Threads, but all i can get is the Thread IDs not the Names, so
i don't know which is which...
Help me Obi Wan... I've been at this three days, and i only had 4 hours
sleep last night.
Thx All.