Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf

所需积分/C币:9 2017-04-02 16:26:50 5.94MB PDF
收藏 收藏

Parallel and Distributed Programming
Section 3.7. Terminating a Process Section 3.8. Process resources Section 3.9. What are Asynchronous and Synchronous Processes? Section 3.10. Dividing the Program into Tasks Summary Section4i1.Threads: A Definition nto Multiple Threads Chapter 4. Dividing C++ Program Section 4.2. The Anatomy of a Thread Section 4.3. Thread Scheduling Section 44. thread resources Section 45. Thread models Section 4.6. Introduction to the Pthread Library Section 4.7. The Anatomy of a Simple Threaded Program Section 4.8. Creating Threads Section 4.9. Managing Threads Section 4. 10. T hread safety and Libraries Section 4.11. Dividing Your Program into Multiple Threads Summa Chapter 5. Synchronizing Concurrency between Tasks Section 5. 1. Coordinating Order of Execution Section 5.2. Synchronizing Access to Data Section 5.3. What are Semaphores? Section 5. 4. Synchronization: An Object-Oriented Approach ummary chapter 6. Adding Parallel Programming Capabilities to C++ Through the Pvm Section 6. 1. The Classic Parallelism Models Supported by PVM Section 6.2. The PVM Library for C++ Section 6.3. the Basic mechanics of the pvm Section 6. 4. Accessing Standard Input(stdin) and Standard Output(stdout) within PVM Tasks Summary Chapter 7. Error Handling Exceptions, and Software Reliability Section 7.1. What is Software Reliability? Section 7.2. Failures in Software layers and hardware Components ection Definitions of Defects Depend on Software Section 7. 4. Recognizing Where to Handle Defects versus Where to section 7.. Software Reliability: A Simple Plan Section 7.6. Using map Objects in Error Handling Section 7.7 Exception Handling mechanisms in C++ Section 7.8. Event Diagrams, Logic Expressions, and Logic Diagrams Summary Chapter 8. Distributed object-Oriented Programming in C++ Section 8. 1. Decomposition and Encapsulation of the Work Section 8.2. Accessing Obiects in Other Address Spaces Section 8.3. The Anatomy of a Basic CORBA Consumer Section 8.4. The Anatomy of a CORBaProducer Section 8.5. The Basic Blueprint of a CoRBAApplication Section 8.6. The Naming Service Section 8.7. A Closer Look at Obiect Adapters Section 8.8. Implementation and Interface Repositories Section 8.9. Simple Distributed Web Services Using COrBa Section 8.10. The Trading Service Section 8.11. The Client/Server Paradigm Summary Chapter 9. SPMD and MPMD Using Templates and the MPl Section 9.1. Work breakdown structure for the mei Section 9. 2. Using Template Functions to Represent MPI Tasks Section 9.3. Simplifying mPl communicatio ns Summary Chapter 10. Visualizing concurrent and Distributed System Design Section 10.1. Visualizing Structures Section 10.2. Visualizing concurrent Behavior Section 10.3. Visualizing the Whole System Summary Chapter 11. Designing Components That Support Concurrency Section 11.1. Taking Advantage of Interface Classes Section A Closer Look at Obiect-Oriented Mutual Exclusion and Interface Classes Section 113. Maintaining the Stream Metaphor ection11.4. User-Defined Classes Designed to Work with PvM Section 11.5. Obiect-Oriented Pipes and fifos as Low-Level Building Blocks Section 11.6. Framework Classes Components for Concurrency Summary Chapter 12. Implementing Agent-Oriented Architectures Section 12.1. What are Agents? Section 12.2. What is Agent-Oriented Programming? Section 12.3. Basic Agent Components Section 12. 4. Implementing Agents in C++ Section 12.5. Multiagent Systems Summary lapter 13. Blackboard Architectures Using PVM, Threads, and Components Section 13.1. The blackboard model Section 13.2. Approaches to Structuring the blackboard Section 13.3. The Anatomy of a Knowledge Source Section 13. 4. The Control Strategies for Blackboards Section 13. 7. Activating Knowledge Sources Using P sc Section 13.5. Implementing the Blackboard Using CorBa obed Section 13.6. Implementing the blackboard Using global obj Summary Appendix A. Diagrams Section A 1. Class and object Diagrams Section A. 2. Interaction Diagrams Section A.3. State Diagrams Section A. 4. Package Diagrams Appendix B. System Interfaces Bibliography [Team LiB ITeam LiB I Copyright Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and Addison-Wesley was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals The authors and publisher have taken care in the preparation of this book but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. no liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. The publisher offers discounts on this book when ordered in quantity for bulk purchases and special sales. For more information, please contact U.S. Corporate and Government Sales 800)3823419 corpsales( For sales outside of the U.s., please contact nternational sales (317)5813793 international( A CiP catalog record for this book can be obtained from the library of congress Copyright C 2004 by Pearson Education, Inc All rights reserved No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form, or by any means electronic, mechanical, photocopying, recording, or otherwise without the prior consent of the publisher. Printed in the United States of America. Published simultaneously in Canada For information on obtaining permission for use of material from this work, please submit a written request Pearson education Inc Rights and Contracts Department 75 Arlington Street, Suite 300 Boston mao2116 Fax(617)848-7047 Text printed on recycled paper 12345678910 First printing, June 2003 Dedication This book is dedicated to all the code warriors, white hat hackers, midnight engineers, and count/ess volunteers who have tirelessly given their skill, talent, experience, and time to make the open-source movement a reality and the Linux revolution possible. Without their tremendous contributions, the software needed to explore cluster programming, MPP programming, SMP programming, and distributed programming would simply not be as widely accessible and available to everyone in the world as it now is Team LiB I ITeam LiB I Preface We present an architectural approach to distributed and parallel programming using the C++ language Particular attention is paid to how the C++ standard library, algorithms, and container classes behave in distributed and parallel environments. Methods for extending the C++ language through class libraries and function libraries to accomplish distributed and parallel programming tasks are explained. Emphasis is placed on how C++ works with the new PosiX and Single UNIX standards for multithreading Combining C++ executables with other language executables to achieve multilingual solutions to distributed or parallel programming problems is also discussed Several methods of organizing software that support parallel and distributed programming are introduced We demonstrate how to remove the fundamental obstacles to concurrency. t he notion of emergent parallelization is explored. Our focus is not on optimization techniques, hardware specifics, performance comparisons, or on trying to apply parallel programming techniques to complex scientific or mathematical algorithms; rather, on how to structure computer programs and software systems to take advantage of opportunities for parallelization. Furthermore, we acquaint the reader with a multiparadigm approach to solving some of the problems that are inherent with distributed and parallel programming. Effective solutions to these problems often require a mix of several software design and engineering approaches For instance, we deploy object-oriented programming techniques to tackle data race and synchronization problems. We use agent-oriented architectures to deal with multi-process and multithread management Blackboards are used to minimize communication issues. In addition to object-oriented, agent-oriented and Al-oriented programming, we use parameterized programming to implement generalized algorithms that are suitable where concurrency is required. Our experience with the development of software of all sizes and shapes has led us to believe that successful software design and implementation demands versatility. T he suggestions, ideas, and solutions we present in this book reflect that experience ITeam LiB 4 PREVIUVSNE8IP ITeam LiB I The Challenges There are three basic challenges to writing parallel or distributed programs 1. Identifying the natural parallelism that occurs within the context of a problem domain 2. Dividing the software appropriately into two or more tasks that can be performed at the same time to accomplish the required parallelism 3. Coordinating those tasks so that the software correctly and efficiently does what it is supposed to do These three challenges are accompanied by the following obstacles to concurrency Data race Deadlock detection Partial failure Latency Deadlock Communication failures Termination detection Lack of global state Multiple clock problem Protocol mismatch Localized errors Lack of centralized resource allocation This book explains what these obstacles are, why they occur, and how they can be managed Finally, several of the mechanisms we use for concurrency use TCP/P as a protocol. Specifically the MPI(Message Passing Interface) library, PVM(Parallel Virtual Machine) library, and the MICo (CORBA) library. This allows our approaches to be used in an internet/Intranet environment, which means that programs cooperating in parallel may be executing at different sites on the Internet or a corporate intranet and communicating through message passing Many of the ideas serve as foundations for infrastructure of Web services. In addition to the mP i and pvm routines, the corbaobjects we use can communicate from different servers accross the Internet. These components can be used to provide a variety of Internet/intranet services Team LiB 4 PREWIOUS NEXT R ITeam LiB I The Approach We advocate a component approach to the challenges and obstacles found in distributed and parallel programming. Our primary objective is to use framework classes as building blocks for concurrency. the framework classes are supported by object-oriented mutexes, semaphores, pipes, and sockets. the complexity of task synchronization and communication is significantly reduced through the use of interface classes. We deploy agent-driven threads and processes to facilitate thread and process management. Our primary approach to a global state and its related problems involve the use of blackboards. We combine agent-oriented and object-oriented architectures to accomplish multiparadigm solutions. Our multiparadigm approach is made possible using the support C++ has for object-oriented programming, parameterized programming, and structured programming TEam LiB I ITeam LiB I Why C++? There are C++ compilers available for virtually every platform and operating environment. the ansi (American National Standards Institute)and Iso(International Standard Organization) have defined standards for the C++ language and its library there are robust open-source implementations as well as commercial implementations of the language. The language has been widely adopted by researchers, designers, and professional developers around the world. the C++ language has been used to solve problems of all sizes and shapes from device drivers to large-scale industrial applications the language supports a multiparadigm approach to software development and libraries that add parallel and distributed programming capabilities are readily available Team LiB] L NEI

试读 127P Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf
立即下载 低至0.43元/次 身份认证VIP会员低至7折
    Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf 9积分/C币 立即下载
    Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf第1页
    Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf第2页
    Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf第3页
    Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf第4页
    Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf第5页
    Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf第6页
    Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf第7页
    Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf第8页
    Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf第9页
    Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf第10页
    Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf第11页
    Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf第12页
    Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf第13页
    Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf第14页
    Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf第15页
    Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf第16页
    Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf第17页
    Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf第18页
    Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf第19页
    Parallel and Distributed Programming Using C++-Addison Wesley(2003).pdf第20页

    试读结束, 可继续阅读

    9积分/C币 立即下载 >