Home > Store > Programming > C/C++

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

Register your product to gain access to bonus material or receive a coupon.

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

Best Value Purchase

Book + eBook Bundle

  • Your Price: $75.59
  • List Price: $125.98
  • We're temporarily out of stock, but order now and we'll send it to you later.
  • Includes EPUB, MOBI, and PDF
  • About eBook Formats
  • This eBook includes the following formats, accessible from your Account page after purchase:

    ePub EPUB The open industry format known for its reflowable content and usability on supported mobile devices.

    MOBI MOBI The eBook format compatible with the Amazon Kindle and Amazon Kindle applications.

    Adobe Reader PDF The popular standard, used most often with the free Adobe® Reader® software.

    This eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.

More Purchase Options

Book

  • Your Price: $55.99
  • List Price: $69.99
  • We're temporarily out of stock, but order now and we'll send it to you later.

eBook (Watermarked)

  • Your Price: $44.79
  • List Price: $55.99
  • Includes EPUB, MOBI, and PDF
  • About eBook Formats
  • This eBook includes the following formats, accessible from your Account page after purchase:

    ePub EPUB The open industry format known for its reflowable content and usability on supported mobile devices.

    MOBI MOBI The eBook format compatible with the Amazon Kindle and Amazon Kindle applications.

    Adobe Reader PDF The popular standard, used most often with the free Adobe® Reader® software.

    This eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.

About

Features

How-to book for ACE, an open-source toolkit for developing high-performance applications.

° An intro guide for ACE beginners, and an authoritative reference for all ACE users.

° Foreword by Dr. Douglas C. Schmidt--the original developer of ACE.

° 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.

Description

  • Copyright 2004
  • Dimensions: 7-3/8x9-1/4
  • Pages: 544
  • Edition: 1st
  • Book
  • ISBN-10: 0-201-69971-0
  • ISBN-13: 978-0-201-69971-5

If you're designing software and systems that must be portable, flexible, extensible, predictable, reliable, and affordable, this book and the ACE toolkit will enable you to be more effective in all of these areas. Even after spending over a decade developing ACE and using it to build networked software applications, I find that I've learned a great deal from this book, and I'm confident that you will, too.
--Douglas C. Schmidt, Inventor of ACE, from the Foreword

This book is a must-have for every ACE programmer. For the beginner, it explains step-by-step how to start using ACE. For the more experienced programmer, it explains in detail the features used daily, and is a perfect reference manual. It would have saved me a lot of time if this book had been available some years ago!
--Johnny Willemsen, Senior Software Engineer, Remedy IT, The Netherlands

With a large C++ code base, we rely on ACE to enable a cross-platform client-server framework for data quality and data integration. ACE has improved our design and smoothed over OS idiosyncrasies without sacrificing performance or flexibility. The combination of online reference materials and printed "big picture" guides is indispensable for us, and The ACE Programmer's Guide earns top-shelf status in my office.
--John Lilley, Chief Scientist, DataLever Corporation

In SITA air-ground division, we are one of the major suppliers of communication services to the airline industry. We started using ACE about a year ago and are now moving most of our new communication-related development to it. I can say that using this toolkit can reduce the development and testing time by at least 50% in our type of application.
--Jean Millo, Senior Architect, SITA

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.

The accompanying CD-ROM contains the complete ACE toolkit, including installable kits for Windows, Solaris, and HP-UX; complete reference documentation for all of the ACE classes; and source code for every example in the book.



0201699710B10142003

Sample Content

Online Sample Chapter

Using the ACE Logging Facility

Downloadable Sample Chapter

Download the Sample Chapter related to this title.

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. 0201699710T11042003

Foreword

I started programming computers in the mid-1980s. Then, like today, computing and communication systems were heterogeneous; that is, there were many different programming languages, operating systems, and networking protocols. Moreover, due to the accidental complexities of programming with low-level and nonportable application programming interfaces (APIs), the types of networked applications available to software developers and end users were relatively primitive, consisting largely of e-mail, remote login, and file transfer. As a result, many applications were either centralized on mainframes and minicomputers or localized on a single stand-alone PC or workstation.

There have been significant advances in information technology (IT) for computing and communication during the intervening two decades. Languages, programming environments, operating systems, networking protocols, and middleware are more mature and standardized. For example, C++ has become an ISO/ANSI standard and is being used in a broad range of application domains. Likewise, the UNIX, Windows, and TCP/IP standards have also become ubiquitous. Even distributed computing middleware standards, such as CORBA, .NET, and J2EE, are becoming widely embraced by the IT industry and end users.

Even with all these advances, however, there is still a layer of the networked software design space--host infrastructure middleware for performance-driven, multiplatform, networked and/or concurrent software systems--that is not well served by standard solutions at other levels of abstraction. Host infrastructure middleware encapsulates native operating system (OS) concurrency and interprocess communication (IPC) mechanisms to alleviate many tedious, error-prone, and nonportable activities associated with developing networked applications via native OS APIs, such as Sockets or POSIX threads (Pthreads). Performance-driven systems also have stringent quality of service (QoS) requirements.

Providing host infrastructure middleware for today's popular computing environments is particularly important for (1) high-performance computing systems, such as those that support scientific visualization, distributed database servers, and online financial trading systems; (2) distributed real-time and embedded systems that monitor and control real-world artifacts, such as avionics mission- and flight-control software, supervisory control and data acquisition systems, and automotive braking systems; and (3) multiplatform applications that must run portably across local- and wide-area networks. These types of systems are increasingly subject to the following trends:

  • The need to access native OS mechanisms to meet QoS requirements. For example, multimedia applications that require long-duration, bidirectional bytestream communication services are poorly suited to the synchronous request/response model provided by conventional distribution middleware. Likewise, many distribution middleware implementations incur significant overhead and lack sufficient hooks to manipulate other QoS-related properties, such as latency, throughput, and jitter.
  • Severe cost and time-to-market pressures. Global competition and market deregulation are shrinking budgets for the in-house development and quality assurance (QA) of software, particularly for the OS and middleware infrastructure. Moreover, performance-driven users are often unable or less willing to pay for specialized proprietary infrastructure software.
  • The demand for user-specific customization. Because performance-intensive software often pushes the limits of technology, it must be optimized for particular runtime contexts and application requirements. General-purpose, one-size-fits-all software solutions often have unacceptable performance.

As these trends continue to accelerate, they present many challenges to developers of tomorrow's networked software systems. In particular, to succeed in today's competitive, fast-paced computing industry, successful middleware and application software must exhibit the following eight characteristics:

  1. Affordability, to ensure that the total ownership costs of software acquisition and evolution aren't prohibitively high
  2. Extensibility, to support successions of quick updates and additions to address new requirements and take advantage of emerging markets
  3. Flexibility, to support a growing range of data types, traffic flows, and end-to-end QoS requirements
  4. Portability, to reduce the effort required to support applications on heterogeneous OS platforms and compilers
  5. Predictability and efficiency, to provide low latency to delay-sensitive real-time applications, high performance to bandwidth-intensive applications, and usability over low-bandwidth networks, such as wireless links
  6. Reliability, to ensure that applications are robust and tolerant of faults
  7. Scalability, to enable applications to handle many users simultaneously
  8. Trustworthiness, to ensure integrity, confidentiality, and availability in internetworked systems

I've encountered all these challenges while working on scores of research and production performance-driven software systems during the past two decades. In 1992, I began creating a software toolkit called the ADAPTIVE Communication Environment (ACE) to address concurrent network programming challenges. ACE is portable object-oriented host infrastructure middleware written in C++. ACE was designed to solve a very pragmatic problem--to save time implementing my doctoral dissertation project on parallel protocol processing engines in both SunOS 4.x and SunOS 5.x operating systems. Having worked on free software projects for many years, I recognized immediately that making ACE available in open-source form would help to galvanize a community whereby other developers and users could assist with the QA, documentation, and support activities needed to transform ACE into a high-quality production software toolkit.

Over the next decade, a core group of around 30 developers and I teamed up with more than 1,700 contributors from around the world to evolve ACE so it encapsulates and augments a wide range of native OS capabilities that are essential to support performance-driven software systems. The core frameworks and wrapper facades in ACE provide an integrated collection of reusable object-oriented classes that simplify and automate connection establishment, event demultiplexing, secure and efficient interprocess communication, (de)marshaling, dynamic configuration of application components, concurrency, and synchronization. Most important, the ACE frameworks can be customized readily to support a wide range of runtime contexts and application requirements.

Today, ACE runs on dozens of hardware and OS platforms, including most versions of Windows and UNIX, as well as many real-time and embedded operating systems. Due to its maturity, efficiency, and scope, ACE is being used by thousands of development teams, ranging from large Fortune 500 companies to small start-ups to advanced research projects at universities and industry labs. Its open-source development model and highly knowledgeable user community is similar in spirit, enthusiasm, and productivity to that driving the Linux operating system, the Apache web server, and the GNU compiler collection.

For many years, however, the only way to learn ACE was to read the source code and example applications, technical papers that described its patterns and the design of its frameworks, and online tutorials. Although a surprisingly large number of ACE users managed to master ACE via this process, the learning curve was time consuming and error prone. In 2002 and 2003, I teamed up with Steve Huston to write a pair of books on C++ Network Programming (C++NP), which cover the motivation, design, implementation, and use of the most popular wrapper facade classes and frameworks in ACE.

The ACE Programmer's Guide takes a different tack from the C++NP books, explaining quickly and directly how to make the best use of ACE. In addition to its nuts-and-bolts approach to explaining key ACE capabilities, this book addresses important topics not covered in the C++NP books, including how to build ACE and your programs that use ACE, ACE's OS and compiler portability features, the ACE logging facility, command line options processing, container classes, signal handling, and shared memory. The book also covers certain material in greater depth than the C++NP books, including concurrency models, bidirectional streams, and asynchronous I/O. Throughout this book, many examples using ACE show how key patterns and design principles can be applied to develop object-oriented networked software successfully. By learning the material in this book, you'll be better able to design and implement performance-driven networked software that can't be bought off-the-shelf, thereby staying ahead of your competition.

We are fortunate that Steve, James, and Umar have found time in their hectic schedules to write this book. If you're designing software and systems that must be portable, flexible, extensible, predictable, reliable, and affordable, this book and the ACE toolkit will enable you to be more effective in all these areas. Even after spending more than a decade developing ACE and using it to build networked software applications, I find that I've learned a great deal from this book, and I'm confident that you will too.

--Douglas C. Schmidt
Professor of Electrical Engineering and Computer Science atVanderbilt University and Inventor of ACE
Nashville, Tennessee

Index

Download the Index file related to this title.

Updates

Submit Errata

More Information

Unlimited one-month access with your purchase
Free Safari Membership