My question may not be with regard to real-time processing, but again, maybe.
My application has several threads, which are much more important than the graphical interface, BUT, I want the GUI to be at least useful. I do not want it to be locked at all times, and I want to update the screen, the received processing result, which I perform.
Currently, all of my main elements are isolated in separate threads, and I call a delegate in my GUI to display the results.
My GUI works, but if I change the tabs or minimize / maximize it, as you know, it interferes with my other threads to such an extent that they cannot perform their operations within 0.1 s to which they are bound.
This is what I do to call my delegate:
delegate void FuncDelegate(ResultContainer Result); FuncDelegate DelegatedDisplay= new FuncDelegate(DisplayResults);
Most of my critical processes are threads that run in continuous loops, are pulled, and go into various buffers (ArrayLists and regular lists).
One of my critical threads starts every time using:
Thread mythread = new Thread(new ThreadStart(ProcessResults)); mythread.Start();
The reason I decided to do this, instead of having a thread running in a loop, pulling from lists, was because I thought that the reason I was running out of hours was because I have the polling cycle that I worry consumes too many resources (although I use Thread.Sleep (5) every time the polling becomes negative).
Does a new thread start every time I need a parallel process, does it cost me valuable time? Should it be a loop? Are my loops to blame?
Can I pass a thread higher priority than others, or use Thread.Sleep only my option? If I prioritize a higher thread, how can I be sure that other threads can even survive?
Why do simple form events interfere with my other flows? Is there a way to give my GUI thread a designated, less resource? Can I use Thread.Sleep to somehow block Form events if there is not enough time in other threads?
Concluding the answer to all my disappointing questions, is there some kind of thread profiler that I can use to help determine my mess? I tried using the "Managed Stack Explorer", but for some reason this does not always show which threads my application has.
Any help on this would help me a lot.