RobotStudio event

Multitasking

When using PERS variables shared across say two Tasks I assume they are read/write thread-safe ?

Comments

  • lemster68
    lemster68 ✭✭✭
    IF You mean that the values in all tasks are updated the same?  Then yes.
    Lee Justice
  • No meant when two asynchronous Tasks (or threads) simultaneously access a common variable there's usually a system error - have seen it on Staubli robots (a problem I had to fix for a client). This is done by using a mutex or semaphore (ABB has such the WaitTestAndSet instruction). Usually IO is thread-safe, the OS handles collisions - I assume (hope) PERS values are handled like IO
  • lemster68
    lemster68 ✭✭✭
    In that case, if you do have separate tasks changing values, (which is probably best to try to avoid), the WaitTestAndSet is a good option.  Or, like you mentioned IO, set a bit when one task is modifying a value, and all others must wait for that bit to go low again.
    Lee Justice