RobotStudio event

PCSDK-Mastership requests in a multithreaded app?


Anyone out there used the Mastership request object within a multithreaded application?  I'm wondering how this behaves if multiple threads are all trying to request mastership from within the same program.

Thanks,
Dan.

John Wiberg2012-03-07 13:58:33

Comments

  • DanS
    DanS ✭✭
    Anyone else doing this?


  • Never tried it myself but mastership is exactly that - one is master the rest is not.
    So if one thread would have mastership any new requests would be denied.
     
    But if you have a common controller object then you could handle that in a multithreaded app. Just get mastership once and then use Controller.IsMaster to check every now and then. Then use a reference to the common controller and pass through to all different parts of the code.