关键词:对象编程;信号和协同程序;通信
摘 要:Concurrent object-oriented programming in Beta is based on semaphores and coroutines and the ability to define high-level concurrency abstractions like monitors, and rendezvous-based communication, and their associated schedulers. The coroutine mechanism of SIMULA has been generalized into the notions of concurrent and alternating objects. Alternating objects may be used to start a cooperative thread for each possible blocking communication and is thus an alternative to asynchronous messages and guarded commands. Beta like SIMULA, the first OO language, was designed as a language for modeling as well as programming, and we describe how this has had an impact on the design of the language. Although Beta supports the definition of high-level concurrency abstractions, the use of these rely on the discipline of the programmer as is the case for Java and other mainstream OO languages. We introduce the notion of subpattern (including subclass) restrictions as a mechanism for defining safe concurrency abstractions. Subpattern restrictions have been implemented in a new experimental version of Beta, called xBeta.