Click here to Skip to main content
14,733,301 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
Hi Team, 

Having windows application tool, in this tool we are using thread concepts to execute scripts.

If I run the thread then CPU usage is going to reach more than 95% to 100%.

Once stopped the thread then CPU Usage comes to normal(15%).

Please Explain and give solution?

If I am using 100% (Thread) then my system going to hang and get very slow.

How to solve the problem/.
Posted
Comments
[no name] 13-Oct-14 6:06am
   
Okay... the CPU usage goes up because it's busy doing stuff.
The solution is, obviously, not to do anything.
Garth J Lancaster 13-Oct-14 6:11am
   
snicker - and I thought I was sarcastic - but... yes
[no name] 13-Oct-14 6:31am
   
Well he did only ask for an explanation and a solution.... :-)
Garth J Lancaster 13-Oct-14 6:12am
   
so, how do we know what your thread is doing - maybe you should update your question and show us what the code is - we cant read your mind or see your screen
Mohankumar.Engain 13-Oct-14 6:16am
   
Wes Aday,
While running this application, I am not doing anything,
Only running this tool alone in my PC, but CPS speed automatically increased to 100%.
[no name] 13-Oct-14 6:30am
   
Wrong. You are doing something otherwise the CPU would be idle. What you are doing we can't tell you because you have given us exactly zero relevant information. We can't see your computer, your project, your code or read your mind to know what it is that you are doing.
Mohankumar.Engain 13-Oct-14 6:21am
   
Garth J Lancaster,
Actually execute the scripts line by line
Thread execute one by one.
Garth J Lancaster 13-Oct-14 6:35am
   
that's tells us nothing about what the thread is actually doing - if your not going to explain clearly what work the thread is doing how do you expect to be helped ?
BillWoodruff 13-Oct-14 6:40am
   
Are you creating more than one thread ?
Mohankumar.Engain 13-Oct-14 6:50am
   
No Nothing, I am using single thread only.
Dave Kreskowiak 13-Oct-14 7:59am
   
That screen shot tells us absolutely f***ing nothing!

We would need to see the code that is executing that script. Since you can't seem to understand that little concept, it looks like you're never going to get an answer to your question.
Mohankumar.Engain 13-Oct-14 8:13am
   
Simple code, Just calling a thread,
Thread is reading row by row from this grid view(refer screen shot: [Script_Image]),
and return value based on script. and bind to grid view another column.

1 solution

Since you refuse to show us the code that's causing the problem, you're on your own. There is NO WAY to answer this question without seeing the code.

Have a nice life.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900