ACE Programmer's Guide, The: Practical Design Patterns for Network and Systems Programming

The ADAPTIVE Communication Environment (ACE) is an open-source software toolkit created to solve network programming challenges. Written in C++, with the help of 30 core developers and 1,700 contributors, this portable middleware has evolved to encapsulate and augment a wide range of native OS capabilities essential to support performance-driven software systems.

The ACE Programmer's Guide is a practical, hands-on guide to ACE for C++ programmers building networked applications and next-generation middleware. The book first introduces ACE to beginners. It then explains how you can tap design patterns, frameworks, and ACE to produce effective, easily maintained software systems with less time and effort. The book features discussions of programming aids, interprocess communication (IPC) issues, process and thread management, shared memory, the ACE Service Configurator framework, timer management classes, the ACE Naming Service, and more.

1100302958
ACE Programmer's Guide, The: Practical Design Patterns for Network and Systems Programming

The ADAPTIVE Communication Environment (ACE) is an open-source software toolkit created to solve network programming challenges. Written in C++, with the help of 30 core developers and 1,700 contributors, this portable middleware has evolved to encapsulate and augment a wide range of native OS capabilities essential to support performance-driven software systems.

The ACE Programmer's Guide is a practical, hands-on guide to ACE for C++ programmers building networked applications and next-generation middleware. The book first introduces ACE to beginners. It then explains how you can tap design patterns, frameworks, and ACE to produce effective, easily maintained software systems with less time and effort. The book features discussions of programming aids, interprocess communication (IPC) issues, process and thread management, shared memory, the ACE Service Configurator framework, timer management classes, the ACE Naming Service, and more.

49.49 In Stock
ACE Programmer's Guide, The: Practical Design Patterns for Network and Systems Programming

ACE Programmer's Guide, The: Practical Design Patterns for Network and Systems Programming

ACE Programmer's Guide, The: Practical Design Patterns for Network and Systems Programming

ACE Programmer's Guide, The: Practical Design Patterns for Network and Systems Programming

eBook

$49.49  $65.99 Save 25% Current price is $49.49, Original price is $65.99. You Save 25%.

Available on Compatible NOOK devices, the free NOOK App and in My Digital Library.
WANT A NOOK?  Explore Now

Related collections and offers


Overview

The ADAPTIVE Communication Environment (ACE) is an open-source software toolkit created to solve network programming challenges. Written in C++, with the help of 30 core developers and 1,700 contributors, this portable middleware has evolved to encapsulate and augment a wide range of native OS capabilities essential to support performance-driven software systems.

The ACE Programmer's Guide is a practical, hands-on guide to ACE for C++ programmers building networked applications and next-generation middleware. The book first introduces ACE to beginners. It then explains how you can tap design patterns, frameworks, and ACE to produce effective, easily maintained software systems with less time and effort. The book features discussions of programming aids, interprocess communication (IPC) issues, process and thread management, shared memory, the ACE Service Configurator framework, timer management classes, the ACE Naming Service, and more.


Product Details

ISBN-13: 9780672334184
Publisher: Pearson Education
Publication date: 05/15/2010
Sold by: Barnes & Noble
Format: eBook
Pages: 544
File size: 4 MB
Age Range: 18 Years

About the Author

Stephen D. Huston is President and CEO of Riverace Corporation, a provider of technical support and consulting services to companies who want to keep software projects on track using ACE. Steve has nearly ten years of experience with ACE, and more than twenty years of software development experience, focusing on network protocol and C++ networked application development in a wide range of hardware and software environments.

Read an Excerpt

ACE (the ADAPTIVE Communication Environment) is a powerful C++ toolkit that helps you develop portable, high-performance applications, especially networked and/or multithreaded applications, more easily and more quickly with more flexibility and fewer errors. And, because of ACE's design and frameworks, you can do all this with much less code than with other development approaches. We've been using ACE for years and have found it exceedingly helpful and well worth any price. What's better is that it's available for free! The historical price many developers have paid to use ACE is a steep learning curve. It's a big toolkit with a large set of capabilities. Until recently, the best documentation has been the source code, which is, of course, freely available, and a set of academic papers born of the research that produced ACE, approachable only by advanced professionals and upper-level students. This barrier to learning has kept ACE's power and easy-to-use elegance one of the best-kept secrets in software development. That's why we're very excited to write this book! It flattens out ACE's learning curve, bringing ACE's power, elegance, and capabilities to all.

This book teaches you about ACE: a bit of its history and approach to development, how it's organized, how to begin using it, and also how to use some of its more advanced capabilities. We teach you how to do things the ACE way in this book, but we could not possibly fit in a complete reference. Use this book to get started with ACE and to begin using it in your work. If you've been using ACE for a while, there are probably descriptions of some capabilities you haven't seen before, so the book is useful for experiencedACE users as well.Who Should Read This Book

This book is meant to serve as both an introductory guide for ACE beginners and a quickly accessible review for experienced ACE users. If you are an ACE beginner, we recommend starting at the beginning and proceeding through the chapters in order. If you are experienced and know what you want to read about, you can quickly find that part of the book and do not need to read the previous sections.

This book is written for C++ programmers who have been exposed to some of the more advanced C++ features, such as virtual inheritance and class templates. You should also have been exposed to basic operating system facilities you plan to use in your work. For example, if you plan to write programs that use TCP/IP sockets, you should at least be familiar with the general way sockets are created, connections are established, and data is transferred.

This book is also an excellent source of material for those who teach others: in either a commercial or an academic setting. ACE is an excellent example of how to design object-oriented software and use C++ to design and write high-performance, easily maintained software systems.Organization

This book is a hands-on, how-to guide to using ACE effectively. The many source code examples illustrate proper use of the pieces of ACE being described. The source code examples are kept fairly short and to the point. Sometimes, the example source is abridged in order to focus attention on a topic. The complete source code to all examples is on the included CD-ROM and is also available on Riverace Corporation's web site. The included CD-ROM also includes a copy of ACE's source kit, installable versions of ACE prebuilt for a number of popular platforms, and complete reference documentation for all the classes in ACE.

The book begins with basic areas of functionality that many ACE users need and then proceeds to build on the foundations, describing the higher-level features that abstract behavior out into powerful patterns.

Part I introduces ACE and provides some generally useful information about the facilities ACE provides. Part I also explains how to configure and build ACE, as well as how to build your applications that use ACE. Widely used programming aids, such as logging and tracing, command line processing and configuration access, and ACE's container classes, are also described.

Part II discusses ACE's facilities for interprocess communication (IPC), beginning with basic, low-level TCP/IP Sockets wrapper classes and proceeding to show how to handle multiple sockets, as well as other events, such as timers and signals, simultaneously using ACE's Reactor and Proactor frameworks. Part II also describes ACE's Acceptor-Connector framework and then ends with a discussion of some of the other IPC wrapper classes ACE offers, many of which are substitutable for TCP/IP wrapper classes in the covered frameworks.

Part III covers a wide range of topics related to process and thread management using ACE. This part explains how to use ACE's process management classes and then covers signals, followed by three chapters about multithreaded programming, thread management, and the critical areas of thread safety and synchronization. Part III ends with discussions of Active Objects and various ways to use thread pools in ACE—critical topics for effective use of multithreading in high-performance applications.

Part IV covers advanced ACE topics: shared memory, the ACE Streams framework for assembling modular data-processing streams, and how to make your applications more flexible and configurable by using the ACE Service Configurator framework. Part IV concludes with an in-depth discussion of ACE's timer management classes and the ACE Naming Service, one of ACE's network services components to assist with often needed networked application programming tasks.

The book concludes with a bibliography and an extensive subject index.Conventions Used in This Book

All ACE classes begin with ACE_. When we refer to patterns instead of the classes they implement, we omit the prefix. For example, the Reactor pattern is implemented by the ACE_Reactor class.

All class member variables are suffixed with '_'. This convention is used in the ACE sources, and we carry it through to the examples in this book as well.

C++ code and file names are set in this font. Command lines are set in this font.

Steve Huston
James CE Johnson
Umar Syyid

Table of Contents



Illustrations.


Tables.


Foreword.


Preface.

I. ACE BASICS.

1. Introduction to ACE.

A History of ACE.

ACE's Benefits.

ACE's Organization.

Patterns, Class Libraries, and Frameworks.

Porting Your Code to Multiple Operating Systems.

Smoothing the Differences among C++ Compilers.

Using Both Narrow and Wide Characters.

Where to Find More Information and Support.

Summary.

2. How to Build and Use ACE in Your Programs.

A Note about ACE Versions.

Guide to the ACE Distribution.

How to Build ACE.

How to Include ACE in Your Applications.

How to Build Your Applications.

Summary.

3. Using the ACE Logging Facility.

Basic Logging and Tracing.

Enabling and Disabling Logging Severities.

Customizing the ACE Logging Macros.

Redirecting Logging Output.

Using Callbacks.

The Logging Client and Server Daemons.

The LogManager Class.

Runtime Configuration with the ACE Logging Strategy.

Summary.

4. Collecting Runtime Information.

Command Line Arguments and ACE_Get_Opt.

Accessing Configuration Information.

Building Argument Vectors.

Summary.

5. ACE Containers.

Container Concepts.

Sequence Containers.

Associative Containers.

Allocators.

Summary.

II. INTERPROCESS COMMUNICATION.

6. Basic TCP/IP Socket Use.

A Simple Client.

Adding Robustness to a Client.

Building a Server.

Summary.

7. Handling Events and Multiple I/O Streams.

Overview of the Reactor Framework.

Handling Multiple I/O Sources.

Signals.

Notifications.

Timers.

Using the Acceptor-Connector Framework.

Reactor Implementations.

Summary.

8. Asynchronous I/O and the ACE Proactor Framework.

Why Use Asynchronous I/O?.

How to Send and Receive Data.

Establishing Connections.

The ACE_Proactor Completion Demultiplexer.

Using Timers.

Other I/O Factory Classes.

Combining the Reactor and Proactor Frameworks.

Summary.

9. Other IPC Types.

Interhost IPC with UDP/IP.

Intrahost Communication.

Summary.

III. PROCESS AND THREAD MANAGEMENT.

10. Process Management.

Spawning a New Process.

Using the ACE_Process_Manager.

Synchronization Using ACE_Process_Mutex.

Summary.

11. Signals.

Using Wrappers.

Event Handlers.

Guarding Critical Sections.

Signal Management with the Reactor.

Summary.

12. Basic Multithreaded Programming.

Getting Started.

Basic Thread Safety.

Intertask Communication.

Summary.

13. Thread Management.

Types of Threads.

Priorities and Scheduling Classes.

Thread Pools.

Thread Management Using ACE_Thread_Manager.

Signals.

Thread Start-Up Hooks.

Cancellation.

Summary.

14. Thread Safety and Synchronization.

Protection Primitives.

Thread Synchronization.

Thread-Specific Storage.

Summary.

15. Active Objects.

The Pattern.

Using the Pattern.

Summary.

16. Thread Pools.

Understanding Thread Pools.

Half-Sync/Half-Async Model.

Leader/Followers Model.

Thread Pools and the Reactor.

Summary.

IV. ADVANCED ACE.

17. Shared Memory.

ACE_Malloc and ACE_Allocator.

Persistence with ACE_Malloc.

Position-Independent Allocation.

ACE_Malloc for Containers.

Wrappers.

Summary.

18. ACE Streams Framework.

Overview.

Using a One-Way Stream.

A Bidirectional Stream.

Summary.

19. ACE Service Configurator Framework.

Overview.

Configuring Static Services.

Setting Up Dynamic Services.

Setting Up Streams.

Reconfiguring Services During Execution.

Using XML to Configure Services and Streams.

Configuring Services without svc.conf.

Singletons and Services.

Summary.

20. Timers.

Timer Concepts.

Timer Queues.

Prebuilt Dispatchers.

Managing Event Handlers.

Summary.

21. ACE Naming Service.

The ACE_Naming_Context.

A Single-Process Naming Context: PROC_LOCAL.

Sharing a Naming Context on One Node: NODE_LOCAL.

Sharing a Naming Context across the Network: NET_LOCAL.

Summary.

Bibliography.
Index.

Introduction

ACE (the ADAPTIVE Communication Environment) is a powerful C++ toolkit that helps you develop portable, high-performance applications, especially networked and/or multithreaded applications, more easily and more quickly with more flexibility and fewer errors. And, because of ACE's design and frameworks, you can do all this with much less code than with other development approaches. We've been using ACE for years and have found it exceedingly helpful and well worth any price. What's better is that it's available for free! The historical price many developers have paid to use ACE is a steep learning curve. It's a big toolkit with a large set of capabilities. Until recently, the best documentation has been the source code, which is, of course, freely available, and a set of academic papers born of the research that produced ACE, approachable only by advanced professionals and upper-level students. This barrier to learning has kept ACE's power and easy-to-use elegance one of the best-kept secrets in software development. That's why we're very excited to write this book! It flattens out ACE's learning curve, bringing ACE's power, elegance, and capabilities to all.

This book teaches you about ACE: a bit of its history and approach to development, how it's organized, how to begin using it, and also how to use some of its more advanced capabilities. We teach you how to do things the ACE way in this book, but we could not possibly fit in a complete reference. Use this book to get started with ACE and to begin using it in your work. If you've been using ACE for a while, there are probably descriptions of some capabilities you haven't seen before, so the book is useful for experienced ACEusers as well.

Who Should Read This Book

This book is meant to serve as both an introductory guide for ACE beginners and a quickly accessible review for experienced ACE users. If you are an ACE beginner, we recommend starting at the beginning and proceeding through the chapters in order. If you are experienced and know what you want to read about, you can quickly find that part of the book and do not need to read the previous sections.

This book is written for C++ programmers who have been exposed to some of the more advanced C++ features, such as virtual inheritance and class templates. You should also have been exposed to basic operating system facilities you plan to use in your work. For example, if you plan to write programs that use TCP/IP sockets, you should at least be familiar with the general way sockets are created, connections are established, and data is transferred.

This book is also an excellent source of material for those who teach others: in either a commercial or an academic setting. ACE is an excellent example of how to design object-oriented software and use C++ to design and write high-performance, easily maintained software systems.

Organization

This book is a hands-on, how-to guide to using ACE effectively. The many source code examples illustrate proper use of the pieces of ACE being described. The source code examples are kept fairly short and to the point. Sometimes, the example source is abridged in order to focus attention on a topic. The complete source code to all examples is on the included CD-ROM and is also available on Riverace Corporation's web site. The included CD-ROM also includes a copy of ACE's source kit, installable versions of ACE prebuilt for a number of popular platforms, and complete reference documentation for all the classes in ACE.

The book begins with basic areas of functionality that many ACE users need and then proceeds to build on the foundations, describing the higher-level features that abstract behavior out into powerful patterns.

Part I introduces ACE and provides some generally useful information about the facilities ACE provides. Part I also explains how to configure and build ACE, as well as how to build your applications that use ACE. Widely used programming aids, such as logging and tracing, command line processing and configuration access, and ACE's container classes, are also described.

Part II discusses ACE's facilities for interprocess communication (IPC), beginning with basic, low-level TCP/IP Sockets wrapper classes and proceeding to show how to handle multiple sockets, as well as other events, such as timers and signals, simultaneously using ACE's Reactor and Proactor frameworks. Part II also describes ACE's Acceptor-Connector framework and then ends with a discussion of some of the other IPC wrapper classes ACE offers, many of which are substitutable for TCP/IP wrapper classes in the covered frameworks.

Part III covers a wide range of topics related to process and thread management using ACE. This part explains how to use ACE's process management classes and then covers signals, followed by three chapters about multithreaded programming, thread management, and the critical areas of thread safety and synchronization. Part III ends with discussions of Active Objects and various ways to use thread pools in ACE--critical topics for effective use of multithreading in high-performance applications.

Part IV covers advanced ACE topics: shared memory, the ACE Streams framework for assembling modular data-processing streams, and how to make your applications more flexible and configurable by using the ACE Service Configurator framework. Part IV concludes with an in-depth discussion of ACE's timer management classes and the ACE Naming Service, one of ACE's network services components to assist with often needed networked application programming tasks.

The book concludes with a bibliography and an extensive subject index.

Conventions Used in This Book

All ACE classes begin with ACE_. When we refer to patterns instead of the classes they implement, we omit the prefix. For example, the Reactor pattern is implemented by the ACE_Reactor class.

All class member variables are suffixed with '_'. This convention is used in the ACE sources, and we carry it through to the examples in this book as well.

C++ code and file names are set in this font. Command lines are set in this font.

Steve Huston
James CE Johnson
Umar Syyid

From the B&N Reads Blog

Customer Reviews