Zusammenfassung:
|
There is a big class of problems that require software systems with
asynchronously executed components. For example, distributed computations
have the distributed nodes that process the data asynchronously to one anot-
her, service-oriented architectures need to process separate requests asynchrono-
usly, and multi-core and heterogeneous systems need to have multiple separa-
te tasks running concurrently to best utilize the hardware. Even ordinary GUI
applications need asynchronous components – the user interface needs to be re-
sponsive at all times which means that no matter in what state the program is
in, it needs to process and react to the input events coming from the user. The
necessity of concurrency and asynchronous execution brings in the added com-
plexity of the
Inversion of Control
(IoC) into the system, either through mes-
sage passing or through event processing. IoC makes code difficult to develop
and reason about, it increases component coupling and inhibits clean functional
or object-oriented software design.
In this dissertation, a method for solving the problems that IoC introduces is
presented. It presents a way to model both synchronous and different types of
asynchronous tasks with the continuation monad. The continuation monad serves
as a primitive to build more complex control flow structures that mimic the control
flow structures of the host programming language. It also allows for building more
complex control structures specialized for parallelism, transactional execution, and
for simulating functional programming idioms with asynchronous tasks through a
generalization of the continuation monad that allows the asynchronous tasks to
generate results one at a time. This allows for writing programming systems with
asynchronously executed components by writing seemingly synchronous imperati-
ve or functional code while leaving it up to the compiler to do all the heavy lifting
and convert the written code to asynchronously executed set of tasks. Another
benefit of the presented method is that it allows for easier automatic handling of
the data lifetime without the need for garbage collection.
This method has been successfully applied and tested in several Free/Libre
Open Source Software and proprietary real-world software projects used by hun-
dreds of millions of people around the world. In this dissertation, an example of a
secure project management system is described which is based on a similar system
implemented as a part of the KDE Plasma project. This dissertation also contains
the important parts of the implementation of the AsynQt library which extends
the Qt library, and its concurrency primitive – QFuture class – with functional
reactive programming patterns based on the method proposed in this dissertation. |