Parent Child +----------+ +-------------------------+ +------------------------+ |Start: | |Decides remote data is | |Detects value of 1; | |$state_var|==>|needed; parent changes |==>|Attempts to fetch the | |value = 0 | |the value from 0 to 1. | |data using LWP. | +----------+ +-------------------------+ | | ^ +-------------------------+ |Success: Child changes | | |Detects the value of 2; | |the value from 1 to 2, | | |Reads the shared queue to| |and writes the data back| +===========|retrieve the data, change|<==|to the shared queue. | | |the value from 2 to 0, | | | | |and return to Start. | |Failure: Child changes | | +-------------------------+ |the value from 1 back to| | |0 to indicate failure, | +=========================================|and returns to Start. | +------------------------+