DIRECTORY YggEnvironment USING [Outcome, TransID, nullTransID], YggImport USING [Handle, nullHandle], YggInternal USING [Difficulty, FileInstanceHandle, LockTransHeaderHandle, LogRecordID, nullLogRecordID, WorkerOutcome, WorkLevel], BasicTime USING [GMT], YggDummyProcess USING [Milliseconds], YggDummyRPC USING [ConversationID]; YggWorker: DEFINITIONS = BEGIN State: TYPE = { unknown, active, preparing, ready, completing, fpmComplete, fpmCompleteBeingForcedOut, complete }; StateDuringRecovery: TYPE = { active, ready, committed, aborted }; Outcome: TYPE = YggEnvironment.Outcome --{abort, commit, unknown}--; Object: TYPE = MONITORED RECORD [ transID: YggEnvironment.TransID _ YggEnvironment.nullTransID, --immutable-- beginRecord: YggInternal.LogRecordID _ YggInternal.nullLogRecordID, --immutable-- coordinator: YggImport.Handle _ YggImport.nullHandle, --immutable-- locks: YggInternal.LockTransHeaderHandle _ NIL, --immutable-- coordinatorIsRemote: BOOL _ TRUE, state: State _ unknown, --increases monotonically to complete-- outcome: Outcome _ unknown, --changes during state transition ready -> completing-- allowableDifficulty: Difficulty _ hard, nStarts: [0..maxStarts] _ 0, stateDuringRecovery: StateDuringRecovery _ active, timeOfLastStartWork: BasicTime.GMT, estimatedUpdateCost: INT _ 0, fileInstanceList: YggInternal.FileInstanceHandle _ NIL, enabledWheelList: LIST OF YggDummyRPC.ConversationID _ NIL, continueWorker: Handle _ nullHandle, --holds continuation transaction, if any-- next: Handle _ nullHandle --WorkerMap data structure-- ]; Handle: TYPE = REF Object; nullHandle: Handle = NIL; shortWaitTime: YggDummyProcess.Milliseconds = 100; Difficulty: TYPE = YggInternal.Difficulty; --{zero, normal, hard} WorkLevel: TYPE = YggInternal.WorkLevel; --Difficulty [normal .. hard] maxStarts: CARDINAL = 7; BeginLogRep: TYPE = MACHINE DEPENDENT RECORD [ coordinator: StrBody]; CompletingLogRep: TYPE = MACHINE DEPENDENT RECORD [ outcome: YggInternal.WorkerOutcome]; StrBody: TYPE = MACHINE DEPENDENT RECORD [ length: CARDINAL _ 0, maxLength: CARDINAL _ 64, text: PACKED ARRAY[0..64) OF CHAR]; END. žYggWorker.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Defines the volatile and persistent state of a worker. Worker.Handle is the concrete form of YggInternal.TransactionHandle. Last edited by MBrown on January 30, 1984 11:50:47 am PST Taft on 1-Feb-82 12:57:26 Hauser, March 8, 1985 11:13:52 am PST Bob Hagmann March 23, 1988 4:55:29 pm PST hard -> normal -> zero during preparing or completing state. Prevents new actions that dirty owner DB caches (CreateFile, ...) from starting during Prepare. ReadPages and WritePages are allowed during Prepare. Number of actions in progress for this worker. More precisely, the number of StartWorking calls that returned TRUE, minus number of StopWorking calls. State maintained during the analysis pass of recovery. Time of last successful call to StartWork. 0 means that the transaction is readonly. The estimatedUpdateCost increases during the transaction. Data structure giving access to all files opened by this transaction. List of all conversations that are enabled to perform "protected" Alpine operations under this transaction. Timeout for a condition variable on which workers wait in order to let some transient condition pass. no interface procedure involving transactions has zero difficulty most have normal difficulty anything that can dirty a cache that must be flushed during Prepare is hard. Bound on number of concurrent actions allowed for a single worker. Persistent worker state. Note that workerReady and workerComplete log records contain no information other than the transaction ID, so we don't define structures for them here. Hauser, March 8, 1985 11:13:36 am PST Nodified, added copyright. Κ?˜šœ™Icodešœ Οmœ1™<—Jšœ6™6JšœD™Dšœ™Jšœ*™*Jšœ™K™%K™)—˜šΟk ˜ Jšœžœ!˜5Jšœ žœ˜%šœ žœ8˜IJ˜8—Jšœ žœžœ˜Jšœžœ˜%Jšœ žœ˜#J˜——šœ ž œ˜Jšž˜J˜šœžœ3˜>J˜3J˜—Jšœžœ)˜BJ˜Jšœ žœΟcœ˜DJ˜šœžœž œžœ˜!Jšœ>Ÿ ˜KJšœDŸ ˜QJšœ6Ÿ ˜CJšœ+žœŸ ˜=Jšœžœžœ˜!JšœŸ'˜?JšœŸ7˜S˜'Jšœ<™