cT an Imperative Language with Parallelizing Features Supporting the Computation Model Auto
合集下载
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
tended for the development of portable software for multiprocessors in the environment supporting the computation model \autotransformation of evaluation network". The language was designed as an extension of C programming language with the new language primitives that represent the notions of the computation model. As a result, there was produced an imperative language with functa multiprocessor we mean a network built of conventional Von Neuman style monoprocessor elements.
2 Computation Model and its Implementation
Our approach is based on the following principles: 1. The whole computation process is an autotransformation of a network, the nodes of which are data and processes. Data and processes are situated in cells, i.e. in tagged parts of memory of di erent size. The arcs connecting the cells into a network are specially organized pointers. At the start of computation the network consists of a single root process. 2. Processes are active parts of a network and are responsible for its transformation. During its work the process can generate new data and modify or even delete its own existing data. Moreover, any process can generate another process or a network of processes to which the fragments of the network can be transferred as inputs. 3. Every process is linked by one or several arcs to the cells-consumers outside the process. The process sends returned values to the cells-consumers via these links. When one of the returned values is sent to the consumers, the corresponding link is destroyed. The process terminates when all its links are destroyed, i.e. all the returned values are sent. Sending of the returned values is the only way the process can change the part of the network to which it is linked. 4. The cells-consumers contain the so called \unevaluated values". If a process tries to use such a value in its own computations, it is announced to be not ready and is suspended. The process is announced to be ready again when this cell-consumer receives the evaluated value and becomes an ordinary cell. Thus, the inter-process synchronization is implicit. In more detail this computation model is described in 1]. Since the process modi es the evaluation network only by sending the returned values, it has no side e ect. That allows to run all the ready processes in parallel. To provide paralellizing the process may be transferred from one monoprocessor to another, and run-time support system can do this automatically. The available run-time system, implementing the computation model, is based on vector representation of lists and garbage collection. In vector representation a list is a sequence of cells situated in the memory successively. If the list has a regular structure there can be provided the direct access to any cell, i.e. indexing. To connect the list with the rest part of the computation network and to prevent it from being deleted by garbage collection, a cell containing a reference to this list is used. This cell is called a holder. The holder also contains the number of the cells in the list. As an example you can look at Fig. 1 where is shown a list consisting of 11 cells 'information', and its holder.
Fig. 1. A sample list in vector representation.
Apart from holding the list in memory, the holder may be used to provide the access to the list. The cell, containing a holder also can be an element of a list. Thus a list with any number of nesting levels can be built. So far we have not discussed an important issue { the internal structure of a process. Generally speaking, in terms of the computation model it's irrelevant, if the rules described above and specifying the characteristics of the model are followed. The processes used in the available implementation of the computation model are very similar to processes as they are used in operating systems. A process has a code, data and a stack. Inside the process the computation is being performed in the traditional von Neuman manner. Thus for a process the memory is divided into two unequal parts: inner world and outer space, and the rules of behaviour in this two parts are very di erent.
Research Centre for Multiprocessor Systems Program Systems Institute of the Russian Academy of Sciences Pereslavl-Zalessky, Russia
Abstract. In this paper we present the programming language cT, in-
1 Introduction
It's a common knowledge that programmingfor multiprocessors1 is very tiresome and time consuming. Besides, the software for multiprocessors is hardly portable. One of the ways to eliminate these drawbacks is to make a computer-independent system for the development of the parallel software, that provides automatic parallelizing of programs. Now there are available many implementations of functional languages with parallelizing features 2]. But their syntax usually repels those programmers, who are used to imperative languages. In this paper we discuss an approach to the development of parallel software, that allows one to combine syntactical and semantic paradigms of well-known imperative languages, C in particular, with the possibilities of parallelizing, provided by functional languages. The approach is based on the use of a computation model called \autotransformation of evaluation network" 1]. Section 2 of the paper provides a short description of the computation model and some peculiarities of its implementing by run-time support system. Section 3 contains an introduction to cT programming language. Finally, we present a sample program to give an illustration to the preceding summary of the language and conclude with some prospective comments on future work.
cT: an Imperative Language with Parallelizing Features Supporting the Computation Model \Autotransformation of the Evaluation Network"
Alexey I. Adamovich