CPU time consuming program
-
Hello! We are developing a program in c#, we have a problem with probably the threading. After a few minutes running our program, it starts to consume all cpu time, we have not started any own threads. The running thread does not seem to have any priority, it does not slow down any other programs, it just overrides the idle thread, it seems. Does anyone know of any known problem using c# concering out problem, or has any other ideas of what the problem might be. M
-
Hello! We are developing a program in c#, we have a problem with probably the threading. After a few minutes running our program, it starts to consume all cpu time, we have not started any own threads. The running thread does not seem to have any priority, it does not slow down any other programs, it just overrides the idle thread, it seems. Does anyone know of any known problem using c# concering out problem, or has any other ideas of what the problem might be. M
Mikke_x wrote: After a few minutes running our program, it starts to consume all cpu time, we have not started any own threads. The running thread does not seem to have any priority, it does not slow down any other programs, it just overrides the idle thread, it seems. The idle thread is the lowest of the low in terms of priority. Of course your application will override it - it is supposed to do that. The idle thread is just what the OS does when it has nothing else to do. As your application is doing something the OS is therefore not, by definition, idle.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar The Second EuroCPian Event will be in Brussels on the 4th of September Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way! My Blog
-
Mikke_x wrote: After a few minutes running our program, it starts to consume all cpu time, we have not started any own threads. The running thread does not seem to have any priority, it does not slow down any other programs, it just overrides the idle thread, it seems. The idle thread is the lowest of the low in terms of priority. Of course your application will override it - it is supposed to do that. The idle thread is just what the OS does when it has nothing else to do. As your application is doing something the OS is therefore not, by definition, idle.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar The Second EuroCPian Event will be in Brussels on the 4th of September Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way! My Blog
Yeah of course. The problem here was that the process used 99% of the processor all the time. Altough it looked like it had really low priority since it did only use the processor if no other thread wanted to execute. We did resolve the problem however. Can´t really explain the reason behind the problem, but it was because of a sleeping thread. We started a thread when we started the application and suspended it immedediately. Now we have changed it so that we don´t start the thread until we need it instead of starting it and suspend it from the start. M