any potential threading error?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • winningElevent
    New Member
    • Oct 2007
    • 15

    any potential threading error?

    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.
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    I also want to have a backgroundworke r thread to keep checking for the connection between desktop and device.
    Is it necessary to poll for the device. Doesn't ActiveSync raise an event when a device connects or disconnects?

    Comment

    • winningElevent
      New Member
      • Oct 2007
      • 15

      #3
      I'm not sure if it's necessary but I thought it would be nice to keep monitoring to update text information to the GUI about the connection status. I'm not planing to use ActiveSync functions, but I may use an open source wraper RAPI.

      thanks you for your suggestion and thanks for moving the post to here because I was unable to create new post in other byte forums..

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32663

        #4
        Originally posted by winningElevent
        ... because I was unable to create new post in other byte forums..
        Check out HELP! My ACCOUNT is DISABLED!

        Comment

        Working...