R17 – Atomic code may call another atomic block (deadlock possible) (WMB)

Atomic code may call another atomic block (deadlock possible) (WMB)

Atomic blocks allow for “critical sections” of code to be implemented such that only one thread/execution can be running that section of code in the same execution group at once.
This means that when a critical section calls to another critical section it may be possible to create a deadlock situation where nether critical section can complete.

For example ATOMICROUTING : BEGIN ATOMIC — beginning of atomic block
    CALL AtomicProcedure();
END ATOMICROUTING ; — end of the atomic block

CREATE PROCEDURE AtomicProcedure() BEGIN
    EMBEDDEDATOMIC : BEGIN ATOMIC — beginning of atomic block. Processing is single threaded until the END; is reached
      SET OutputRoot.XMLNSC.SoapMessage.SoapBody.Person.Name = ‘Fred’;
    END EMBEDDEDATOMIC ; — end of the ROUTING atomic block
END;