Abstract

Object-oriented Programming has been effective in reducing code complexity in sequential programs, but in current practice, concurrent programs still present a number of challenges. We present here a model of object-oriented programming that identifies concurrent tasks and the relationship between objects and tasks , effectively making objects concurrency-aware . This awareness is formalized in a parallel programming model where every object plays a role in every task (e.g., the readonly role). When an object is shared with a new task, it adapts to the new sharing pattern by changing its roles, and therefore its behavior, i.e., the operations that can be performed with this object. This mechanism can be leveraged to prevent interfering accesses from concurrently executing tasks, and therefore makes parallel execution deterministic. To this end, we present a role-based programming language that includes several novel concepts (role transitions, guarding, slicing) to enable practical, object-oriented deterministic parallel programming. We show that this language can be used to safely implement programs with a range of different parallel patterns. The implementations to 8 widely used programming problems achieve substantial parallel speedups and demonstrate that this approach delivers performance roughly on par with manually synchronized implementations.

Highlights

  • The object-oriented programming paradigm has proven to be effective in taming complexity in software systems

  • We present a formal definition of the Parallel Roles programming model, including the sketch of a formal proof of determinism (Section 3)

  • How much performance can be gained by using such a language? This question includes two aspects: how much parallelism can be expressed and how much overhead is added by the runtime mechanisms like role transitions and guarding?

Read more

Summary

Introduction

The object-oriented programming paradigm has proven to be effective in taming complexity in software systems. By encapsulating related data and code into objects, object-oriented programming (oop) enables programmers to reason about complex software systems in a modular way. Such encapsulation makes it simple to express and maintain invariants about the state of an object, because direct access to that state is restricted to that object’s methods. Many advantages of oop are severely limited in a concurrent setting. When there are multiple concurrently executing threads in a system, it becomes difficult to maintain object invariants, because the assumption that there is exactly one executing method at a time is violated

Methods
Results
Conclusion

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.