SPECIAL OFFER
Use code BACKTOLEARN during checkout to save 50% on books, eBooks, & videos. Shop now.
Register your product to gain access to bonus material or receive a coupon.
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.
The ADAPTIVE Communication Environment (ACE) is an open-source toolkit for building high-performance networked applications and next-generation middleware. ACE's power and flexibility arise from object-oriented frameworks, used to achieve the systematic reuse of networked application software. ACE frameworks handle common network programming tasks and can be customized using C++ language features to produce complete distributed applications. This book will teach developers how they can use the ACE framework to develop their software. It will also show real-world uses of design patterns and C++. Benefits: Reduces the ACE learning curve, gain a clear understanding of how to use ACE to produce high-performance software using less time and effort; Provides a cookbook for solutions to common software engineering problems.
Using the ACE Logging Facility
Download the Sample
Chapter related to this title.
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.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:
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:
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
Download the Index
file related to this title.