The article is devoted to a number of solutions for organizing work with memory in educational languages and programming systems aimed at teaching the preparation of multi-threaded programs over shared memory. The consideration was carried out within the framework of the SYNCHRO programming language for educational purposes, which made it possible to analyze variants of such solutions without the limitations typical for traditional manufacturing tools and devices of standard programming systems. The article gives a clear formulation of an abstract machine and a diagram of a command system that allows you to define the behavior of a program as a distributed system from a number of threads interacting in terms of access to the values of variables located in shared memory. The de-vice of shared memory and mechanisms of access to it by individual processes, which are a sequence of command execution, some of which are requests to shared memory, are described. The focus is on the convenience of debugging small programs used to introduce concurrency problems in the learning process, where the pace of learners’ under-standing of the problems is more important than achieving program efficiency and performance. The solution to this problem is useful when studying programming methods, as well as studying the history of programming languages, comparing programming paradigms, the potential of the schemes and models used, assessing the level of novelty of the programming languages being created, creating a technique for measuring different characteristics of programs on models and choosing criteria for the practicality of the created programs. When choosing a system of commands for an abstract machine, the principles of functional programming were taken into account as a popular paradigm at the stage of preparing prototypes and models of multi-threaded programs. From these principles, the conclusion is drawn of the consequences that allow you to successfully select elementary instructions that support working with memory in the style of data immutability and their transactional processing. For educational tasks in programming, the ability to ensure the correctness and completeness of solutions is more important than the efficiency and productivity of the received programs. This is the path to building reliable and secure software.
Read full abstract