Delete from the start Delete from the end

  • Slides: 13
Download presentation
 • Delete from the start • Delete from the end • Delete from

• Delete from the start • Delete from the end • Delete from the middle

If this element is the first element in the chain, then the delete operation

If this element is the first element in the chain, then the delete operation has an effect that is similar to Pop:

The last link in the chain simply disappears: The disappearance is described by range

The last link in the chain simply disappears: The disappearance is described by range subtraction; the data type invariant is enough to determine the new value of end.

The previous element which is identified as links~ p? will be mapped to the

The previous element which is identified as links~ p? will be mapped to the next element which is identified as links p? . In this schema, p? itself is removed using domain restriction

Design • a design for the scheduler based upon the chain data type. •

Design • a design for the scheduler based upon the chain data type. • Our design will involve three chains: one each for the sets of ready, blocked, and free processes.

The initial states of the ready and blocked chains are defined in terms of

The initial states of the ready and blocked chains are defined in terms of the initialization schema Chain. Init

The free chain is initially full

The free chain is initially full

 • We will require push and pop operations on the ready and free

• We will require push and pop operations on the ready and free chains, and push and delete operations on the blocked chain. • We may define these by renaming the components of the corresponding operations on Chain:

The state of the concrete scheduler comprises the three chains, together with an optional

The state of the concrete scheduler comprises the three chains, together with an optional current process It is also useful to identify the working space used: the component chainstore is the union of the three chain functions, plus an optional map to null. PId.

 • Initially, there is no current process, and all chains are empty:

• Initially, there is no current process, and all chains are empty:

When a process is dispatched to the processor, the ready chain is popped; the

When a process is dispatched to the processor, the ready chain is popped; the result becomes the current process. When a process is created, an identifier is popped o the free chain and pushed onto the ready chain. . Repeat for others such as CWakeup, CDestroy. Ready