Safe-by-default Concurrency for Modern Programming Languages

2021 ◽  
Vol 43 (3) ◽  
pp. 1-50
Author(s):  
Lun Liu ◽  
Todd Millstein ◽  
Madanlal Musuvathi

Modern “safe” programming languages follow a design principle that we call safety by default and performance by choice . By default, these languages enforce important programming abstractions, such as memory and type safety, but they also provide mechanisms that allow expert programmers to explicitly trade some safety guarantees for increased performance. However, these same languages have adopted the inverse design principle in their support for multithreading. By default, multithreaded programs violate important abstractions, such as program order and atomic access to individual memory locations to admit compiler and hardware optimizations that would otherwise need to be restricted. Not only does this approach conflict with the design philosophy of safe languages, but very little is known about the practical performance cost of providing a stronger default semantics. In this article, we propose a safe-by-default and performance-by-choice multithreading semantics for safe languages, which we call volatile -by-default . Under this semantics, programs have sequential consistency (SC) by default, which is the natural “interleaving” semantics of threads. However, the volatile -by-default design also includes annotations that allow expert programmers to avoid the associated overheads in performance-critical code. We describe the design, implementation, optimization, and evaluation of the volatile -by-default semantics for two different safe languages: Java and Julia. First, we present V BD-HotSpot and V BDA-HotSpot, modifications of Oracle’s HotSpot JVM that enforce the volatile -by-default semantics on Intel x86-64 hardware and ARM-v8 hardware. Second, we present S C-Julia, a modification to the just-in-time compiler within the standard Julia implementation that provides best-effort enforcement of the volatile -by-default semantics on x86-64 hardware for the purpose of performance evaluation. We also detail two different implementation techniques: a baseline approach that simply reuses existing mechanisms in the compilers for handling atomic accesses, and a speculative approach that avoids the overhead of enforcing the volatile -by-default semantics until there is the possibility of an SC violation. Our results show that the cost of enforcing SC is significant but arguably still acceptable for some use cases today. Further, we demonstrate that compiler optimizations as well as programmer annotations can reduce the overhead considerably.


2014 ◽  
Vol 26 (2) ◽  
pp. 303-364 ◽  
Author(s):  
DIMITRIOS KOUZAPAS ◽  
NOBUKO YOSHIDA ◽  
RAYMOND HU ◽  
KOHEI HONDA

Event-driven programming is one of the major paradigms in concurrent and communication-based programming, where events are typically detected as the arrival of messages on asynchronous channels. Unfortunately, the flexibility and performance of traditional event-driven programming come at the cost of more complex programs: low-level APIs and the obfuscation of event-driven control flow make programs difficult to read, write and verify.This paper introduces a π-calculus with session types that modelsevent-driven session programming(called ESP) and studies its behavioural theory. The main characteristics of the ESP model are asynchronous, order-preserving message passing, non-blocking detection of event/message arrivals and dynamic inspection of session types. Session types offer formal safety guarantees, such as communication and event handling safety, and programmatic benefits that overcome problems with existing event-driven programming languages and techniques. The new typed bisimulation theory developed for the ESP model is distinct from standard synchronous or asynchronous bisimulation, capturing the semantic nature of eventful session-based processes. The bisimilarity coincides with reduction-closed barbed congruence.We demonstrate the features and benefits of ESP and the behavioural theory through two key use cases. First, we examine an encoding and the semantic behaviour of the event selector, a central component of general event-driven systems, providing core results for verifying type-safe event-driven applications. Second, we examine the Lauer–Needham duality, building on the selector encoding and bisimulation theory to prove that a systematic transformation from multithreaded to event-driven session processes is type- and semantics-preserving.



2015 ◽  
Vol 6 (1) ◽  
pp. 50-57
Author(s):  
Rizqa Raaiqa Bintana ◽  
Putri Aisyiyah Rakhma Devi ◽  
Umi Laili Yuhana

The quality of the software can be measured by its return on investment. Factors which may affect the return on investment (ROI) is the tangible factors (such as the cost) dan intangible factors (such as the impact of software to the users or stakeholder). The factor of the software itself are assessed through reviewing, testing, process audit, and performance of software. This paper discusses the consideration of return on investment (ROI) assessment criteria derived from the software and its users. These criteria indicate that the approach may support a rational consideration of all relevant criteria when evaluating software, and shows examples of actual return on investment models. Conducted an analysis of the assessment criteria that affect the return on investment if these criteria have a disproportionate effort that resulted in a return on investment of a software decreased. Index Terms - Assessment criteria, Quality assurance, Return on Investment, Software product



2013 ◽  
Vol 1 (3) ◽  
pp. 48-65
Author(s):  
Yuting Chen

A concurrent program is intuitively associated with probability: the executions of the program can produce nondeterministic execution program paths due to the interleavings of threads, whereas some paths can always be executed more frequently than the others. An exploration of the probabilities on the execution paths is expected to provide engineers or compilers with support in helping, either at coding phase or at compile time, to optimize some hottest paths. However, it is not easy to take a static analysis of the probabilities on a concurrent program in that the scheduling of threads of a concurrent program usually depends on the operating system and hardware (e.g., processor) on which the program is executed, which may be vary from machine to machine. In this paper the authors propose a platform independent approach, called ProbPP, to analyzing probabilities on the execution paths of the multithreaded programs. The main idea of ProbPP is to calculate the probabilities on the basis of two kinds of probabilities: Primitive Dependent Probabilities (PDPs) representing the control dependent probabilities among the program statements and Thread Execution Probabilities (TEPs) representing the probabilities of threads being scheduled to execute. The authors have also conducted two preliminary experiments to evaluate the effectiveness and performance of ProbPP, and the experimental results show that ProbPP can provide engineers with acceptable accuracy.



2021 ◽  
Vol 30 (3) ◽  
pp. 1-56
Author(s):  
Mouna Abidi ◽  
Md Saidur Rahman ◽  
Moses Openja ◽  
Foutse Khomh

Nowadays, modern applications are developed using components written in different programming languages and technologies. The cost benefits of reuse and the advantages of each programming language are two main incentives behind the proliferation of such systems. However, as the number of languages increases, so do the challenges related to the development and maintenance of these systems. In such situations, developers may introduce design smells (i.e., anti-patterns and code smells) which are symptoms of poor design and implementation choices. Design smells are defined as poor design and coding choices that can negatively impact the quality of a software program despite satisfying functional requirements. Studies on mono-language systems suggest that the presence of design smells may indicate a higher risk of future bugs and affects code comprehension, thus making systems harder to maintain. However, the impact of multi-language design smells on software quality such as fault-proneness is yet to be investigated. In this article, we present an approach to detect multi-language design smells in the context of JNI systems. We then investigate the prevalence of those design smells and their impacts on fault-proneness. Specifically, we detect 15 design smells in 98 releases of 9 open-source JNI projects. Our results show that the design smells are prevalent in the selected projects and persist throughout the releases of the systems. We observe that, in the analyzed systems, 33.95% of the files involving communications between Java and C/C++ contain occurrences of multi-language design smells. Some kinds of smells are more prevalent than others, e.g., Unused Parameters , Too Much Scattering , and Unused Method Declaration . Our results suggest that files with multi-language design smells can often be more associated with bugs than files without these smells, and that specific smells are more correlated to fault-proneness than others. From analyzing fault-inducing commit messages, we also extracted activities that are more likely to introduce bugs in smelly files. We believe that our findings are important for practitioners as it can help them prioritize design smells during the maintenance of multi-language systems.



Author(s):  
Arash Farahani ◽  
Peter Childs

Strip seals are used in gas turbine engines between two static elements or between components which do not move relative to each other, such as Nozzle Guide Vanes (NGVs). The key role of a strip seal between NGV segments is sealing between the flow through the main stream annulus and the internal air system, a further purpose is to limit the inter-segmental movements. In general the shape of the strip seal is a rectangular strip that fits into two slots in adjacent components. The minimum clearance required for static strip seals must be found by accounting for thermal expansion, misalignment, and application, to allow correct fitment of the strip seals. Any increase in leakage raises the cost due to an increase in the cooling air use, which is linked to specific fuel consumption, and it can also alter gas flow paths and performance. The narrow path within the seal assembly, especially the height has the most significant affect on leakage. The height range of the narrow path studied in this paper is 0.01–0.06 mm. The behaviour of the flow passing through the narrow path has been studied using CFD modelling and measurements in a bespoke rig. The CFD and experimental results show that normalized leakage flow increases with pressure ratio before reaching a maximum. The main aim of this paper is to provide new experimental data to verify the CFD modelling for static strip seals. The typical flow characteristics validated by CFD modelling and experiments can be used to predict the flow behaviour for future static strip seal designs.





2011 ◽  
Vol 2011 ◽  
pp. 1-19
Author(s):  
Vinod Namboodiri ◽  
Abtin Keshavarzian

Collection of rare but delay-critical messages from a group of sensor nodes is a key process in many wireless sensor network applications. This is particularly important for security-related applications like intrusion detection and fire alarm systems. An event sensed by multiple sensor nodes in the network can trigger many messages to be sent simultaneously. We present Alert, a MAC protocol for collecting event-triggered urgent messages from a group of sensor nodes with minimum latency and without requiring any cooperation or prescheduling among the senders or between senders and receiver during protocol execution. Alert is designed to handle multiple simultaneous messages from different nodes efficiently and reliably, minimizing the overall delay to collect all messages along with the delay to get the first message. Moreover, the ability of the network to handle a large number of simultaneous messages does not come at the cost of excessive delays when only a few messages need to be handled. We analyze Alert and evaluate its feasibility and performance with an implementation on commodity hardware. We further compare Alert with existing approaches through simulations and show the performance improvement possible through Alert.



Author(s):  
Файзиев Р. А. ◽  
Хаитматов У. Т. ◽  
Азаматов О. Х. ◽  
Джуманиязов Ш. Р. ◽  
Хасанова Х. Х.

The article outlines the main features of the use of the theory of indefinite bundles in the evaluation of the cost-effectiveness of investment projects.He analysis of methods for quantifying the effectiveness of the IP under uncertainty suggests that the existing methods either eliminate the uncertainty from the IP model, which is inappropriate, since uncertainty is an integral characteristic of any forecast, or are unable to formally describe, and take into account all possible varieties of types of uncertainty.Methods based on the theory of fuzzy sets refer to the methods of evaluation and decision-making under conditions of uncertainty. Their use implies the formalization of the initial parameters and performance targets of the IP in the form of a vector of interval values (fuzzy interval), the hit in each interval of which is characterized by a certain degree of uncertainty.Also, the fuzzy-interval approach has advantages in solving the problems of forming an optimal portfolio of investment projects. To solve the problem of forming an optimal IP portfolio, a large number of models for the formation of an optimal IP portfolio have been developed, differing from each other in the form of objective functions, variable properties, used by mathematical methods, and uncertainty.



Sign in / Sign up

Export Citation Format

Share Document