40 likes | 168 Views
What happens when OP1's deposit precedes OP2's Withdrawal?. Thread Processing Problem. First Operator OP1: CA of Mr/Mrs Jones: Second Operator OP2:. (Request is Deposit). (Request is Withdrawal). OPS1: Get Next Request. CAS3: Good Standing.
E N D
What happens when OP1's deposit precedes OP2's Withdrawal? Thread Processing Problem First Operator OP1: CA of Mr/Mrs Jones: Second Operator OP2: (Request is Deposit) (Request is Withdrawal) OPS1: Get Next Request CAS3: Good Standing OPS1: Get Next Request OPS1: Get Next Requestx CAS3: Good Standing OPS1: Get Next Request
(For the case where the deposit precedes the Withdrawal) Thread Processing Solution First Operator OP1: CA of Mr/Mrs Jones: Second Operator OP2: (Request is Deposit) (Request is Withdrawal) OPS1: Get Next Request CAS3: Good Standing OPS1: Get Next Request OPE2 OPS2: Process Request CAdep OPE2 CAS2: Taking Deposit OPE3 CAok CAS3: Good Standing OPS2: Process Request OPS3: Request Succeeded CAwdw OPE5 OPE3 CAS4: Considering Withdrawal CAok OPS3: Request Succeeded OPE5 OPS1: Get Next Request CAS3: Good Standing OPS1: Get Next Request
(Two OPerators access the same account; OP2's Withdrawal try precedes OP1's Deposit) Thread Processing Example First Operator OP1: CA of Mr/Mrs Jones: Second Operator OP2: (OP1 lags behind OP2) OPS1: Get Next Request CAS3: Good Standing OPE2 OPS1: Get Next Request OPS2: Process Request CAwdw OPE2 OPE4 CAS4: Considering Withdrawal CAok CAS3: Good Standing OPS2: Process Request OPS4: Request Failed CAdep OPE5 OPE3 CAS2: Taking Deposit CAok OPS3: Request Succeeded OPE5 OPS1: Get Next Request CAS3: Good Standing OPS1: Get Next Request
ST State /*Behavior of this state */ STid NA c8 1 /* pkey of this ST instance */ SMid NA c8 1 /* fkey of parent State Model */ ActName NA c8 0 /* Action Routine Name/Service */ ActFunc NA c8 0 /* Address of Routine to be called */ Name NA t80 0 /* Full Name or Description of ST */ Active Instance SM StateModel /* Model for all AI's of AC of SM */ SMid NA c8 1 /* pkey of this SM instance */ Abbrev NA c4 0 /* short name - e.g. SM01 */ Name NA t80 0 /* Full Name or Description of SM */ OLCArchitecture (su93olc.sch) AC 1:1 0:1 Active Class AI cstate Runtime Relationships Application Objects (& Sys. Services) (AI and ApplObjs are in 1:1 corresp. ET EventType /*EventType table*/ ETid NA c8 1 /* pkey */ SMid NA c8 1 /* Receiving SM */ Label NA c32 0 /* Event label */ Descrip NA t80 0 /*describes ET*/ Note: Event Label is stored in the ET-parent of each generated EventInstance EI (at EI.ETid_pp->Label) EI TR Transition /* Transition: STid1 to STid2 */ TRid NA c8 1 /* pkey of this TR instance */ STid1 NA c8 1 /* Source or 'From' State */ STid2 NA c8 1 /* Destination or 'To' STate */ Event Instance EN EventEnable /* ET__TR relation */ ENid NA c8 1 /* pkey of ENable row */ ETid NA c8 1 /* fkey of enabling ET */ TRid NA c8 1 /* fkey of enabled TR */ (revised 94/4/26: added Note)