多线程
Pthreads Programming 豆瓣
作者: Bradford Nichols / Dick Buttlar O'Reilly Media 1996 - 9
POSIX threads, or pthreads, allow multiple tasks to run concurrently within the same program. They can share a single CPU as processes do, or take advantage of multiple CPUs when available. In either case, they provide a clean way to divide the tasks of a program while sharing data. This book thoroughly covers the POSIX threads standard, which is supported by the Distributed Computer Environment (DCE), as well as Solaris, OSF/1, AIX, and several other UNIX-based operating systems. In this book you will learn not only what the pthread calls are, but when it is a good idea to use threads and how to make them efficient (which is the whole reason for using threads in the first place). The authors delves into performance issues, comparing threads to processes, contrasting kernel threads to user threads, and showing how to measure speed. He also clearly describes all the advanced features and how threads interact with the rest of the UNIX system.
Systems Performance 豆瓣 Goodreads
作者: Brendan Gregg Prentice Hall 2013 - 10
The accelerating deployment of large-scale web, cloud, Big Data, and virtualized computing systems has introduced serious new challenges in performance optimization. Until now, however, little reliable, practical information has been available to IT professionals who are responsible for running these systems efficiently and cost-effectively.
Systems Performance: Enterprise and the Cloud is the solution. Internationally renowned performance optimization expert Brendan Gregg brings together state-of-the-art techniques and tools for analysis and tuning of large-scale web/cloud computing environments.
Gregg focuses on Linux/Unix/Solaris performance issues, while offering proven methodologies and discussing key issues that apply to all enterprise operating systems. Coverage includes:
Modern performance analysis and capacity planning, including key issues such as latency and dynamic tracing
New performance and reliability challenges associated with cloud computing
Methodology, concepts, terminology, tools, and metrics
Key tradeoffs, including problems of load vs. architecture
Tuning operating systems, CPUs, memory, file systems, disks, networks, and busses
Tuning virtualized systems
Programming language issues related to performance — including application profiling for C, C++, Java, and node.js
Benchmarking strategies and pitfalls, including custom microbenchmarking
Programming with POSIX® Threads 豆瓣
作者: David R. Butenhof Addison-Wesley Professional 1997 - 5
With this practical book, you will attain a solid understanding of threads and will discover how to put this powerful mode of programming to work in real-world applications. The primary advantage of threaded programming is that it enables your applications to accomplish more than one task at the same time by using the number-crunching power of multiprocessor parallelism and by automatically exploiting I/O concurrency in your code, even on a single processor machine. The result: applications that are faster, more responsive to users, and often easier to maintain. Threaded programming is particularly well suited to network programming where it helps alleviate the bottleneck of slow network I/O. This book offers an in-depth description of the IEEE operating system interface standard, POSIXAE (Portable Operating System Interface) threads, commonly called Pthreads. Written for experienced C programmers, but assuming no previous knowledge of threads, the book explains basic concepts such as asynchronous programming, the lifecycle of a thread, and synchronization. You then move to more advanced topics such as attributes objects, thread-specific data, and realtime scheduling. An entire chapter is devoted to "real code," with a look at barriers, read/write locks, the work queue manager, and how to utilize existing libraries. In addition, the book tackles one of the thorniest problems faced by thread programmers-debugging-with valuable suggestions on how to avoid code errors and performance problems from the outset. Numerous annotated examples are used to illustrate real-world concepts. A Pthreads mini-reference and a look at future standardization are also included.
Linux多线程服务端编程 豆瓣 Goodreads
作者: 陈硕 电子工业出版社 2013 - 1
本书主要讲述采用现代C++ 在x86-64 Linux 上编写多线程TCP 网络服务程序的主流常规技术,重点讲解一种适应性较强的多线程服务器的编程模型,即one loop per thread。这是在Linux 下以native 语言编写用户态高性能网络程序最成熟的模式,掌握之后可顺利地开发各类常见的服务端网络应用程序。本书以muduo 网络库为例,讲解这种编程模型的使用方法及注意事项。
本书的宗旨是贵精不贵多。掌握两种基本的同步原语就可以满足各种多线程同步的功能需求,还能写出更易用的同步设施。掌握一种进程间通信方式和一种多线程网络编程模型就足以应对日常开发任务,编写运行于公司内网环境的分布式服务统。