I'm thinking of creating simple test program, but before I jump to coding I would like to ask so I can hopefully avoid any tricky threading bug.
I plan to have a GUI and will have its own thread.
I also want to have a backgroundworke r thread to keep checking for the connection between desktop and device. In that thread, I may have timer for periodically checking maybe every half of second to see if connection is still good. The connection will be with USB cable through ActiveSync. This backgroundworke r thread will never stop running until exiting out the application.
I would like to have another thread, but I don't know what kind of thread should I use. Should I use backgroundworke r thread or simply just Thread. This third thread mainly runs the test process. This thread will stop when finish running all the test process.
In my test program, every time when the connection lost, it will pause the test thread to stop running the test process. For me to that, maybe I should let my backgroundworke r thread to call to the GUI thread then the GUI thread will stop the test thread until backgroundworke r thread notifies connection is good.
Are these considered as safe approach?
thanks.
I plan to have a GUI and will have its own thread.
I also want to have a backgroundworke r thread to keep checking for the connection between desktop and device. In that thread, I may have timer for periodically checking maybe every half of second to see if connection is still good. The connection will be with USB cable through ActiveSync. This backgroundworke r thread will never stop running until exiting out the application.
I would like to have another thread, but I don't know what kind of thread should I use. Should I use backgroundworke r thread or simply just Thread. This third thread mainly runs the test process. This thread will stop when finish running all the test process.
In my test program, every time when the connection lost, it will pause the test thread to stop running the test process. For me to that, maybe I should let my backgroundworke r thread to call to the GUI thread then the GUI thread will stop the test thread until backgroundworke r thread notifies connection is good.
Are these considered as safe approach?
thanks.
Comment