Unified Patterns for Realtime Interactive Simulation in Games

Total Page:16

File Type:pdf, Size:1020Kb

Unified Patterns for Realtime Interactive Simulation in Games Unified Patterns for Realtime Interactive Simulation in Games and Digital Storytelling Dieter Schmalstieg Graz University of Technology Abstract—This paper discusses the state of the art in realtime interactive simulation patterns, which are essential in the development of game engines, digital storytelling, and many other graphical applications. We show how currently popular patterns have evolved from equivalent, or, at least, very similar concepts, and are deeply related. We show that game engines do not need to choose a particular pattern, but can easily combine all desired properties with little or no overhead. Realtime interactive simulations, such as simulation should be flexible in accommodating computer games or cosimulations,1 typically use new entities and new tasks. entities and tasks as their building blocks. A Contemporary game engines, such as Uni- game world or other graphical environment is ty3D, favor the entity/component/system (ECS) populated by entities such as creatures or treas- pattern,2 which makes it easy to extend enti- ures. Many entities coexist, over longer periods ties and tasks independently. ECS decouples of time, and the digital narrative emerges as a entities and tasks, which is often seen as a consequence of their simulated interactions. major advantage over traditional object-ori- The challenge from a programming point of view ented programming techniques. However, it is scalability: We want to make it convenient for does not support communication between the programmer to express the desired simula- 3 entity groups. Mercury has recently shown tion in terms of entities and tasks, and the how Unity3D can be extended with group com- munication based on dataflow, but Mercury still requires to know communication patterns in advance. Figure 1. Relationship of the architectures (blue boxes) discussed in this article. Arrows denote the addition of a particular concept. In this article, we compare several popular register its interest with many subjects, and a communication patterns and show how the com- subject can receive interest from many observ- bination of ECS with dynamic group communica- ers. Moreover, multiple observers can be tion unifies all previously proposed patterns arranged in sequence, allowing indirect notifica- into a coherent whole (Figure 1). tion, provided that events are automatically for- warded to the next observer in the chain. The resulting structure is a dataflow graph (or pipes- NOTIFICATION and-filters pattern),5 a directed graph with enti- In object-oriented languages, entity types are ties as nodes and subject-observer relationships typically derived from an abstract base class, as edges. while tasks are implemented as entity methods. A naive dataflow schedules nodes in depth- Direct method invocations implies that the invok- first order, as with direct method invocations. ing entity must frequently poll the invoked entity Alternatively, a more sophisticated scheduling to learn about any new information. Polling is can interpret the nodes as states in a state wasteful, if there are many entities or infrequent machine. Notification starts at a source node and changes. Moreover, the schedule in which tasks is propagated based on state machine rules (see are carried out is bound to the invocation Figure 2). For example, breadth-first scheduling sequence. We could inadvertently trigger a deep would require that all nodes with a shorter dis- sequence of method invocations, starving more tance to the source must be processed first, urgent tasks. before a given node may be processed. More com- Consequently, we replace polling with noti- plex rules can impose arbitrary topological order- fication: Entities communicate by passing mes- ing on the notifications. For example, one may sages about events that happened in the require that a node has events pending on some simulated world. In order to receive events, an or all of its incoming connections. Such a flexible observer entity registers itself with a subject scheduling can be implemented using a visitor pat- 4 entity to receive notifications. Notification sepa- tern,4 an iterator which traverses a graph accord- rates event creation and consumption. Notifica- ing to a rule set and delivers notifications by tions can be delivered in a different order than invoking a virtual function on each visited node. the one in which the corresponding events Dataflow has been used in many interactive were created. This freedom of reordering notifi- applications. Visualization or image processing cations enables the development of a large vari- pipelines can be set up as dataflow,6 represe- ety of scheduling strategies, suiting the needs of nting filters, transformations, and encodings as diverse flavors of simulation. nodes. Input processing in virtual and augm- ented reality is often specified as dataflow,7 to DATAFLOW stream input from multiple sensors through fil- The observer pattern makes it easy to control ters, fuse operations, and apply geometric notification propagation. A single observer can transformations. Figure 2. (Top) Augmented reality in a folklore museum. Left: The visitor retrieves the flat iron for finding out the initials of the bridal pair; Middle: The visitor heats the iron in the tailor’s oven. Right: The visitor learns about the “wedding rider” custom. (Bottom) Finite state machine expressing the application logic of the folklore museum experience. A scene graph,8 a common data structure for a publish/subscribe architecture:5 Entities pub- visualization and games, can be interpreted as a lish to a notification channel, while other entities special case of dataflow (see Figure 3). The subscribe to this channel. The subscription can visual representation of a scene naturally lends be determined by explicitly associating entities itself to a hierarchical representation, with with channels, but a more powerful scheme nodes representing scene objects (triangles, tex- determines subscription based on dynamic fil- tures, shaders, etc.) or geometric transforma- tering of attributes, such as proximity. An inter- tions. A visitor traverses the nodes of the scene mediary object, the broker, collects events and graph, accumulates a transformaton matrix and delivers notifications. The broker can implement calls a rendering method on each node. arbitrary scheduling strategies and even provide persistent storage. PUBLISH/SUBSCRIBE When the broker collects and buffers many Dataflow supports indirect notification, but events from many entities, temporal ordering still requires explicitly setting up the links of events becomes essential. Proper temporal between entities to send notifications between ordering requires that notifications for events entities. Setting up links for static relationships is are delivered in the half-order induced on the easy, but, if entities act autonomously, associa- events’ time-stamps. tions change in dynamic, unpredictable patterns. In such cases, we would like to specify enti- MODEL/VIEW/CONTROLLER ties to be notified by filtering attributes or speci- If event processing and rendering are cou- fying interests, rather than by enumerating pled together in the same loop, either one of entities directly. Instead of a visitor, we need the two tasks can become a bottleneck. Figure 3. Flow visualization around a space shuttle (left) is modeled as a hybrid of scene graph (middle) and a dataflow graph (right). Simulations should, therefore, incorporate a node to node during visitation, a conventional 9 decoupled simulation pattern that assigns sep- visitor cannot be used. Such a case requires 10 arate threads of control to concurrent tasks. double dispatch, the ability to vary both entity In a decoupled simulation, a broker may place and task dependent on the use case. There are its event queues in shared memory, accepting several ways how double dispatch can be events from entities belonging to one thread implemented: and notifying entities belonging to another thread. Provided we use a strictly asynchro- Multiple inheritance can support double dis- nous scheduling, where no return notifications patch to some degree, but can lead to compe- are required, each task may iterate over the tition among inherited implementations (“deadly diamond of death”). received notifications at its own pace, without blocking other tasks. Reflection can extract a method signature In a simple architecture, a main thread may from events and invoke a corresponding be responsible for brokering events, while other, method. Reflection can either be natively sup- secondary threads are spawned on demand for ported by the language (e.g., C#) or emulated compute-intensive activities and retire after they by parsing a textual event representation. have fulfilled their goal. In a more complex archi- Using reflection is generally considered too costly for processing large amounts of events. tecture, multiple threads may permanently tend to activities such as rendering, AI, animation, A signal/slot pattern can be used, which physics, and so on. allows registering methods of the notified The model/view/controller (MVC) pattern5 object to a particular signal (event). If the describes a common form of decoupled simula- programming language does not support a tion. The model is a common store for the enti- signal/slot construct, it can be implemented ties, while controller and view are tasks by using templates or building a table of func- tion pointers. observing of the model. The view is responsible for rendering, while the controller is responsible The VIGO (views/instruments/governors/obj-
Recommended publications
  • Development of an Entity Component System Architecture for Realtime Simulation
    Fachbereich 4: Informatik Development of an Entity Component System Architecture for Realtime Simulation Bachelorarbeit zur Erlangung des Grades Bachelor of Science (B.Sc.) im Studiengang Computervisualistik vorgelegt von Trevor Hollmann Erstgutachter: Prof. Dr.-Ing. Stefan Müller (Institut für Computervisualistik, AG Computergraphik) Zweitgutachter: Kevin Keul, M.Sc. (Institut für Computervisualistik, AG Computergraphik) Koblenz, im September 2019 Erklärung Ich versichere, dass ich die vorliegende Arbeit selbständig verfasst und keine anderen als die angegebenen Quellen und Hilfsmittel benutzt habe. Ja Nein Mit der Einstellung der Arbeit in die Bibliothek bin ich einverstanden. .................................................................................... (Ort, Datum) (Unterschrift) Abstract The development of a game engine is considered a non-trivial problem. [3] The architecture of such simulation software must be able to manage large amounts of simulation objects in real-time while dealing with “crosscutting concerns” [3, p. 36] between subsystems. The use of object oriented paradigms to model simulation objects in class hierar- chies has been reported as incompatible with constantly changing demands dur- ing game development [2, p. 9], resulting in anti-patterns and eventual, messy re-factoring. [13] Alternative architectures using data oriented paradigms re- volving around object composition and aggregation have been proposed as a result. [13, 9, 1, 11] This thesis describes the development of such an architecture with the explicit goals to be simple, inherently compatible with data oriented design, and to make reasoning about performance characteristics possible. Concepts are for- mally defined to help analyze the problem and evaluate results. A functional implementation of the architecture is presented together with use cases common to simulation software. Zusammenfassung Die Entwicklung einer Spiele-Engine wird als nichttriviales Problem betrach- tet.
    [Show full text]
  • Stclang: State Thread Composition As a Foundation for Monadic Dataflow Parallelism Sebastian Ertel∗ Justus Adam Norman A
    STCLang: State Thread Composition as a Foundation for Monadic Dataflow Parallelism Sebastian Ertel∗ Justus Adam Norman A. Rink Dresden Research Lab Chair for Compiler Construction Chair for Compiler Construction Huawei Technologies Technische Universität Dresden Technische Universität Dresden Dresden, Germany Dresden, Germany Dresden, Germany [email protected] [email protected] [email protected] Andrés Goens Jeronimo Castrillon Chair for Compiler Construction Chair for Compiler Construction Technische Universität Dresden Technische Universität Dresden Dresden, Germany Dresden, Germany [email protected] [email protected] Abstract using monad-par and LVars to expose parallelism explicitly Dataflow execution models are used to build highly scalable and reach the same level of performance, showing that our parallel systems. A programming model that targets parallel programming model successfully extracts parallelism that dataflow execution must answer the following question: How is present in an algorithm. Further evaluation shows that can parallelism between two dependent nodes in a dataflow smap is expressive enough to implement parallel reductions graph be exploited? This is difficult when the dataflow lan- and our programming model resolves short-comings of the guage or programming model is implemented by a monad, stream-based programming model for current state-of-the- as is common in the functional community, since express- art big data processing systems. ing dependence between nodes by a monadic bind suggests CCS Concepts • Software and its engineering → Func- sequential execution. Even in monadic constructs that explic- tional languages. itly separate state from computation, problems arise due to the need to reason about opaquely defined state.
    [Show full text]
  • APPLYING MODEL-VIEW-CONTROLLER (MVC) in DESIGN and DEVELOPMENT of INFORMATION SYSTEMS an Example of Smart Assistive Script Breakdown in an E-Business Application
    APPLYING MODEL-VIEW-CONTROLLER (MVC) IN DESIGN AND DEVELOPMENT OF INFORMATION SYSTEMS An Example of Smart Assistive Script Breakdown in an e-Business Application Andreas Holzinger, Karl Heinz Struggl Institute of Information Systems and Computer Media (IICM), TU Graz, Graz, Austria Matjaž Debevc Faculty of Electrical Engineering and Computer Science, University of Maribor, Maribor, Slovenia Keywords: Information Systems, Software Design Patterns, Model-view-controller (MVC), Script Breakdown, Film Production. Abstract: Information systems are supporting professionals in all areas of e-Business. In this paper we concentrate on our experiences in the design and development of information systems for the use in film production processes. Professionals working in this area are neither computer experts, nor interested in spending much time for information systems. Consequently, to provide a useful, useable and enjoyable application the system must be extremely suited to the requirements and demands of those professionals. One of the most important tasks at the beginning of a film production is to break down the movie script into its elements and aspects, and create a solid estimate of production costs based on the resulting breakdown data. Several film production software applications provide interfaces to support this task. However, most attempts suffer from numerous usability deficiencies. As a result, many film producers still use script printouts and textmarkers to highlight script elements, and transfer the data manually into their film management software. This paper presents a novel approach for unobtrusive and efficient script breakdown using a new way of breaking down text into its relevant elements. We demonstrate how the implementation of this interface benefits from employing the Model-View-Controller (MVC) as underlying software design paradigm in terms of both software development confidence and user satisfaction.
    [Show full text]
  • Immersive Exploration of Hierarchical Networks in VR
    Immersive Exploration of Hierarchical Networks in VR BACHELORARBEIT zur Erlangung des akademischen Grades Bachelor of Science im Rahmen des Studiums Medieninformatik und Visual Computing eingereicht von Manuel Eiweck Matrikelnummer 01633012 an der Fakultät für Informatik der Technischen Universität Wien Betreuung: Univ.Ass. Dr.techn. Manuela Waldner, MSc. Mitwirkung: Dipl.-Ing. Dr.techn. Johannes Sorger Dipl.-Ing. Wolfgang Knecht Wien, 16 April, 2021 Manuel Eiweck Manuela Waldner Technische Universität Wien A-1040 Wien Karlsplatz 13 Tel. +43-1-58801-0 www.tuwien.at Immersive Exploration of Hierarchical Networks in VR BACHELOR’S THESIS submitted in partial fulfillment of the requirements for the degree of Bachelor of Science in Media Informatics and Visual Computing by Manuel Eiweck Registration Number 01633012 to the Faculty of Informatics at the TU Wien Advisor: Univ.Ass. Dr.techn. Manuela Waldner, MSc. Assistance: Dipl.-Ing. Dr.techn. Johannes Sorger Dipl.-Ing. Wolfgang Knecht Vienna, 16th April, 2021 Manuel Eiweck Manuela Waldner Technische Universität Wien A-1040 Wien Karlsplatz 13 Tel. +43-1-58801-0 www.tuwien.at Erklärung zur Verfassung der Arbeit Manuel Eiweck Hiermit erkläre ich, dass ich diese Arbeit selbständig verfasst habe, dass ich die verwendeten Quellen und Hilfsmittel vollständig angegeben habe und dass ich die Stellen der Arbeit – einschließlich Tabellen, Karten und Abbildungen –, die anderen Werken oder dem Internet im Wortlaut oder dem Sinn nach entnommen sind, auf jeden Fall unter Angabe der Quelle als Entlehnung kenntlich gemacht habe. Wien, 16 April, 2021 Manuel Eiweck v Danksagung Einen besonderen Dank möchte ich den Betreuern dieser Arbeit Johannes Sorger, Wolfgang Knecht sowie Manuela Waldner aussprechen welche mich in der Entwick- lungsphase dieser Bachelorarbeit tatkräftig unterstützt haben.
    [Show full text]
  • Procedural Generation of Content in Video Games
    Bachelor Thesis Sven Freiberg Procedural Generation of Content in Video Games Fakultät Technik und Informatik Faculty of Engineering and Computer Science Studiendepartment Informatik Department of Computer Science PROCEDURALGENERATIONOFCONTENTINVIDEOGAMES sven freiberg Bachelor Thesis handed in as part of the final examination course of studies Applied Computer Science Department Computer Science Faculty Engineering and Computer Science Hamburg University of Applied Science Supervisor Prof. Dr. Philipp Jenke 2nd Referee Prof. Dr. Axel Schmolitzky Handed in on March 3rd, 2016 Bachelor Thesis eingereicht im Rahmen der Bachelorprüfung Studiengang Angewandte Informatik Department Informatik Fakultät Technik und Informatik Hochschule für Angewandte Wissenschaften Hamburg Betreuender Prüfer Prof. Dr. Philipp Jenke Zweitgutachter Prof. Dr. Axel Schmolitzky Eingereicht am 03. März, 2016 ABSTRACT In the context of video games Procedrual Content Generation (PCG) has shown interesting, useful and impressive capabilities to aid de- velopers and designers bring their vision to life. In this thesis I will take a look at some examples of video games and how they made used of PCG. I also discuss how PCG can be defined and what mis- conceptions there might be. After this I will introduce a concept for a modular PCG workflow. The concept will be implemented as a Unity plugin called Velvet. This plugin will then be used to create a set of example applications showing what the system is capable of. Keywords: procedural content generation, software architecture, modular design, game development ZUSAMMENFASSUNG Procedrual Content Generation (PCG) (prozedurale Generierung von Inhalten) im Kontext von Videospielen zeigt interessante und ein- drucksvolle Fähigkeiten um Entwicklern und Designern zu helfen ihre Vision zum Leben zu erwecken.
    [Show full text]
  • Process Scheduling
    PROCESS SCHEDULING ANIRUDH JAYAKUMAR LAST TIME • Build a customized Linux Kernel from source • System call implementation • Interrupts and Interrupt Handlers TODAY’S SESSION • Process Management • Process Scheduling PROCESSES • “ a program in execution” • An active program with related resources (instructions and data) • Short lived ( “pwd” executed from terminal) or long-lived (SSH service running as a background process) • A.K.A tasks – the kernel’s point of view • Fundamental abstraction in Unix THREADS • Objects of activity within the process • One or more threads within a process • Asynchronous execution • Each thread includes a unique PC, process stack, and set of processor registers • Kernel schedules individual threads, not processes • tasks are Linux threads (a.k.a kernel threads) TASK REPRESENTATION • The kernel maintains info about each process in a process descriptor, of type task_struct • See include/linux/sched.h • Each task descriptor contains info such as run-state of process, address space, list of open files, process priority etc • The kernel stores the list of processes in a circular doubly linked list called the task list. TASK LIST • struct list_head tasks; • init the "mother of all processes” – statically allocated • extern struct task_struct init_task; • for_each_process() - iterates over the entire task list • next_task() - returns the next task in the list PROCESS STATE • TASK_RUNNING: running or on a run-queue waiting to run • TASK_INTERRUPTIBLE: sleeping, waiting for some event to happen; awakes prematurely if it receives a signal • TASK_UNINTERRUPTIBLE: identical to TASK_INTERRUPTIBLE except it ignores signals • TASK_ZOMBIE: The task has terminated, but its parent has not yet issued a wait4(). The task's process descriptor must remain in case the parent wants to access it.
    [Show full text]
  • Scheduling: Introduction
    7 Scheduling: Introduction By now low-level mechanisms of running processes (e.g., context switch- ing) should be clear; if they are not, go back a chapter or two, and read the description of how that stuff works again. However, we have yet to un- derstand the high-level policies that an OS scheduler employs. We will now do just that, presenting a series of scheduling policies (sometimes called disciplines) that various smart and hard-working people have de- veloped over the years. The origins of scheduling, in fact, predate computer systems; early approaches were taken from the field of operations management and ap- plied to computers. This reality should be no surprise: assembly lines and many other human endeavors also require scheduling, and many of the same concerns exist therein, including a laser-like desire for efficiency. And thus, our problem: THE CRUX: HOW TO DEVELOP SCHEDULING POLICY How should we develop a basic framework for thinking about scheduling policies? What are the key assumptions? What metrics are important? What basic approaches have been used in the earliest of com- puter systems? 7.1 Workload Assumptions Before getting into the range of possible policies, let us first make a number of simplifying assumptions about the processes running in the system, sometimes collectively called the workload. Determining the workload is a critical part of building policies, and the more you know about workload, the more fine-tuned your policy can be. The workload assumptions we make here are mostly unrealistic, but that is alright (for now), because we will relax them as we go, and even- tually develop what we will refer to as ..
    [Show full text]
  • Overload Journal
    “The magazines” The ACCU's C Vu and Overload magazines are published every two months, and contain relevant, high quality articles written by programmers for programmers. “The conferences” Our respected annual developers' conference is an excellent way to learn from the industry experts, and a great opportunity to meet other programmers who care about writing good code. “The community” The ACCU is a unique organisation, run by members for members. There are many ways to get involved. Active forums flow with programmer discussion. Mentored developers projects provide a place for you to learn new skills from other programmers. “The online forums” Our online forums provide an excellent place for discussion, to ask questions, and to meet like minded programmers. There are job posting forums, and special interest groups. Members also have online access to the back issue library of ACCU magazines, through the ACCU web site. Invest in your skills. Improve your join:join: inin code. Share your knowledge. accuaccu || Join a community of people who care about code. Join the ACCU. Use our online registration form at professionalism in programming www.accu.org. www.accu.org Design: Pete Goodliffe Pete Design: OVERLOAD CONTENTS OVERLOAD 144 Overload is a publication of the ACCU April 2018 For details of the ACCU, our publications and activities, ISSN 1354-3172 visit the ACCU website: www.accu.org Editor 4 No News is Good News Frances Buontempo [email protected] Paul Floyd uses Godbolt’s compiler explorer to see what happens when you use ‘new’. Advisors Andy Balaam 8 Monitoring: Turning Noise into Signal [email protected] Chris Oldwood shows the benefits of structured Balog Pal logging.
    [Show full text]
  • Scheduling Light-Weight Parallelism in Artcop
    Scheduling Light-Weight Parallelism in ArTCoP J. Berthold1,A.AlZain2,andH.-W.Loidl3 1 Fachbereich Mathematik und Informatik Philipps-Universit¨at Marburg, D-35032 Marburg, Germany [email protected] 2 School of Mathematical and Computer Sciences Heriot-Watt University, Edinburgh EH14 4AS, Scotland [email protected] 3 Institut f¨ur Informatik, Ludwig-Maximilians-Universit¨at M¨unchen, Germany [email protected] Abstract. We present the design and prototype implementation of the scheduling component in ArTCoP (architecture transparent control of parallelism), a novel run-time environment (RTE) for parallel execution of high-level languages. A key feature of ArTCoP is its support for deep process and memory hierarchies, shown in the scheduler by supporting light-weight threads. To realise a system with easily exchangeable components, the system defines a micro-kernel, providing basic infrastructure, such as garbage collection. All complex RTE operations, including the handling of parallelism, are implemented at a separate system level. By choosing Concurrent Haskell as high-level system language, we obtain a prototype in the form of an executable specification that is easier to maintain and more flexible than con- ventional RTEs. We demonstrate the flexibility of this approach by presenting implementations of a scheduler for light-weight threads in ArTCoP, based on GHC Version 6.6. Keywords: Parallel computation, functional programming, scheduling. 1 Introduction In trying to exploit the computational power of parallel architectures ranging from multi-core machines to large-scale computational Grids, we are currently developing a new parallel runtime environment, ArTCoP, for executing parallel Haskell code on such complex, hierarchical architectures.
    [Show full text]
  • Scheduling Weakly Consistent C Concurrency for Reconfigurable
    SUBMISSION TO IEEE TRANS. ON COMPUTERS 1 Scheduling Weakly Consistent C Concurrency for Reconfigurable Hardware Nadesh Ramanathan, John Wickerson, Member, IEEE, and George A. Constantinides Senior Member, IEEE Abstract—Lock-free algorithms, in which threads synchronise These reorderings are invisible in a single-threaded context, not via coarse-grained mutual exclusion but via fine-grained but in a multi-threaded context, they can introduce unexpected atomic operations (‘atomics’), have been shown empirically to behaviours. For instance, if another thread is simultaneously be the fastest class of multi-threaded algorithms in the realm of conventional processors. This article explores how these writing to z, then reordering two instructions above may algorithms can be compiled from C to reconfigurable hardware introduce the behaviour where x is assigned the latest value via high-level synthesis (HLS). but y gets an old one.1 We focus on the scheduling problem, in which software The implication of this is not that existing HLS tools are instructions are assigned to hardware clock cycles. We first wrong; these optimisations can only introduce new behaviours show that typical HLS scheduling constraints are insufficient to implement atomics, because they permit some instruction when the code already exhibits a race condition, and races reorderings that, though sound in a single-threaded context, are deemed a programming error in C [2, §5.1.2.4]. Rather, demonstrably cause erroneous results when synthesising multi- the implication is that if these memory accesses are upgraded threaded programs. We then show that correct behaviour can be to become atomic (and hence allowed to race), then existing restored by imposing additional intra-thread constraints among scheduling constraints are insufficient.
    [Show full text]
  • Fork-Join Pattern
    Fork-Join Pattern Parallel Computing CIS 410/510 Department of Computer and Information Science Lecture 9 – Fork-Join Pattern Outline q What is the fork-join concept? q What is the fork-join pattern? q Programming Model Support for Fork-Join q Recursive Implementation of Map q Choosing Base Cases q Load Balancing q Cache Locality and Cache-Oblivious Algorithms q Implementing Scan with Fork-Join q Applying Fork-Join to Recurrences Introduction to Parallel Computing, University of Oregon, IPCC Lecture 9 – Fork-Join Pattern 2 Fork-Join Philosophy When you come to a fork in the road, take it. (Yogi Bera, 1925 –) Introduction to Parallel Computing, University of Oregon, IPCC Lecture 9 – Fork-Join Pattern 3 Fork-Join Concept q Fork-Join is a fundamental way (primitive) of expressing concurrency within a computation q Fork is called by a (logical) thread (parent) to create a new (logical) thread (child) of concurrency ❍ Parent continues after the Fork operation ❍ Child begins operation separate from the parent ❍ Fork creates concurrency q Join is called by both the parent and child ❍ Child calls Join after it finishes (implicitly on exit) ❍ Parent waits until child joins (continues afterwards) ❍ Join removes concurrency because child exits Introduction to Parallel Computing, University of Oregon, IPCC Lecture 9 – Fork-Join Pattern 4 Fork-Join Concurrency Semantics q Fork-Join is a concurrency control mechanism ❍ Fork increases concurrency ❍ Join decreases concurrency q Fork-Join dependency rules ❍ A parent must join with its forked children
    [Show full text]
  • An Analytical Model for Multi-Tier Internet Services and Its Applications
    An Analytical Model for Multi-tier Internet Services and Its Applications Bhuvan Urgaonkar, Giovanni Pacificiy, Prashant Shenoy, Mike Spreitzery, and Asser Tantawiy Dept. of Computer Science, y Service Management Middleware Dept., University of Massachusetts, IBM T. J. Watson Research Center, Amherst, MA 01003 Hawthorne, NY 10532 fbhuvan,[email protected] fgiovanni,mspreitz,[email protected] ABSTRACT that is responsible for HTTP processing, a middle tier Java enterprise Since many Internet applications employ a multi-tier architecture, server that implements core application functionality, and a back- in this paper, we focus on the problem of analytically modeling the end database that stores product catalogs and user orders. In this behavior of such applications. We present a model based on a net- example, incoming requests undergo HTTP processing, processing work of queues, where the queues represent different tiers of the by Java application server, and trigger queries or transactions at the application. Our model is sufficiently general to capture (i) the database. behavior of tiers with significantly different performance charac- This paper focuses on analytically modeling the behavior of multi- teristics and (ii) application idiosyncrasies such as session-based tier Internet applications. Such a model is important for the follow- workloads, tier replication, load imbalances across replicas, and ing reasons: (i) capacity provisioning, which enables a server farm caching at intermediate tiers. We validate our model using real to determine how much capacity to allocate to an application in or- multi-tier applications running on a Linux server cluster. Our exper- der for it to service its peak workload; (ii) performance prediction, iments indicate that our model faithfully captures the performance which enables the response time of the application to be determined of these applications for a number of workloads and configurations.
    [Show full text]