1988 | OriginalPaper | Buchkapitel
Device Handling, Concurrency, and Interrupts
verfasst von : Professor Niklaus Wirth
Erschienen in: Programming in Modula-2
Verlag: Springer Berlin Heidelberg
Enthalten in: Professional Book Archive
Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.
Wählen Sie Textabschnitte aus um mit Künstlicher Intelligenz passenden Patente zu finden. powered by
Markieren Sie Textabschnitte, um KI-gestützt weitere passende Inhalte zu finden. powered by
In the last chapter we have discussed systems with several processes and how to simulate concurrent processes by time-sharing a single processor. Now we consider the inverse situation, where several processors participate in the execution of a single process. For the sake of simplicity, let us look at a cyclic process consisting of a producing and a consuming part. Let the process be formulated as $$ LOOPproduce(x);consume(x)END $$Now assume that each part can be executed by a specific processor only. We recognize that at any time only one of the two processors can be active. Hence they need to be synchronized, which is easily accomplished by the introduction of a synchronization variable s with the meaning of, say, “the consumer is active” (and with initial value FALSE). Each of the two sequential processors is now describable by its own program, which is again cyclic.