Advanced Linux Programming (3rd Edition)
Yang Zongde / Lü Guanghong / Liu YongPosts & Telecom Press2012
Rating 3.6- Word count
- 953K words
- Chapters
- 18
- ISBN
- 9787115292902
Tags
Computing Programming Linux ProgrammingMultithreaded ProgrammingOperating SystemProgramming DesignManagement SystemManagement LogicSystems ProgrammingNetwork ProgrammingResource ManagementIntegrated FrameworkSummary
Advanced Linux Programming (3rd Edition), by Yang Zongde, Lü Guanghong, and Liu Yong, is a hands-on textbook on Linux application-level system programming. Taking the Linux operating system's design principle that "everything is a file" as its entry point, the book unfolds around the main thread of "how an execution unit (a process) manages system resources (CPU resources and various file resources)," reorganizing a vast array of system calls according to the logic of resource management so that readers can build an overall framework. The content covers every level of C application programming under Linux: the system programming environment and toolchain (GCC, Makefile, GDB); file and directory management (file attribute control, file reading and writing under ANSI and POSIX standards, terminal and serial port programming); process management and program development (process creation, exit, execution, waiting, and attribute control); interprocess communication (pipes, message queues, shared memory); interprocess synchronization mechanisms (semaphores) and asynchronous mechanisms (signals); multithreaded programming (thread creation, exit, cancellation, and attribute control; mutexes, read-write locks, and condition variables); the coordination of threads and signals; and TCP, UDP, raw sockets, and network server application design in BSD socket network programming. The final chapter also covers the basics of audio application development under Linux. The book's distinguishing feature is its close tie to application: nearly every knowledge point is accompanied by a small application that can be run directly, and the code and examples are mostly drawn from real system programming scenarios rather than abstract concept demonstrations. The authors have long been engaged in teaching and engineering practice, and the chapters progress from tools to files, from processes to threads, and from local communication to network communication, layer by layer. The book has 18 chapters and 486 pages and is suitable both as a companion text for university Linux programming courses and for self-learners with some C background who want to systematically master Linux system interfaces, working through the chapters in order.Editor's review
市面上讲Linux的书写界面操作的很多,讲系统接口的也不少,但大多按API手册的方式逐个罗列函数,读完脑子里是一堆散件。这本书的价值恰在于给出了一个统一的组织逻辑——“一切都是文件”,把标准I/O、目录操作、设备文件、终端、socket统统放在“文件资源”这同一个篮子里,再让“进程”站到资源使用者的位置上去。框架立住了,后面读APUE之类的经典也就有了挂靠点。 另一个可称道之处是代码量大且成体系。作者多年教学与工程实践积累的例程,多数是可以编译、可以直接看现象的小程序,而不是伪代码。对自学者来说,先跑通、再改、再理解,比先啃定义要有效得多。第3版在进程、线程、网络三块尤其扎实,TCP高级应用与网络服务器应用设计这两章,把从socket创建到并发服务模型的链条补完整了,对做嵌入式网关、后台服务的读者很有用。 当然也要有心理准备:这是一本教材式的书,语言朴素,不炫技,例子偏工程而少趣味;部分环境描述以Linux 2.6内核、GCC 4.0/GDB 6.3为基准,今天在较新的发行版上运行,个别编译选项和调试行为需要自己微调。把这一点当成练习也无妨——能把老代码在新系统上跑通,本身就是对理解程度的检验。总体而言,它是中文Linux系统编程书里少有的“能顺着读完”的一本。Who it's for
A good fit for
- 有C语言基础、想系统学习Linux系统接口的程序员
- 需要在嵌入式Linux平台上做应用开发的工程师
- 高校开设Linux程序设计、操作系统实践课程的学生
- 从Windows平台转到Linux做后台服务开发的技术人员
Not a good fit for
- 完全零编程基础的读者,需要先补C语言与命令行
- 只想了解Linux桌面使用与运维命令的读者
Reading tips
- 先读完第1、2章,把GCC、Makefile、GDB三件工具用熟,后面的例程才好动手
- 每章的示例都亲自编译运行,并尝试修改参数观察系统行为变化
- 重点吃透第8至12章的进程与线程部分,这是全书承上启下的核心
- 遇到与新版内核、新版GCC不一致的报错,记录差异并查阅手册,当作额外练习
About the publisher
Posts & Telecom Press China · Founded in 1953Posts & Telecom Press is known for its strengths in science and technology, computing, and information and communications titles, and has extended its publishing into photography, art, software learning, and inspirational growth, giving it a fairly diverse range. Its catalog includes computing and communications works such as Refactoring and Patterns (Revised Edition) and Huawei Switch Learning Guide (Second Edition), alongside bilingual collector's editions such as The Little Prince (Chinese-English-French illustrated collector's edition), The Great Gatsby, and Three Days to See. Beijing Ten Years: 1980-1990 and Ghost Blade: WLOP Personal Illustration Collection reflect its presence in photography and art. Its authors include Antoine de Saint-Exupéry, Helen Keller, Joshua Kerievsky, Wang Da, Zhang Zhaozeng, and WLOP.
Contents
- Chapter 1: The C Development Environment under Linux
- Chapter 2: C Development Tools under Linux
- Chapter 3: Linux Process Memory Management
- Chapter 4: ANSI C File I/O Management
- Chapter 5: POSIX File and Directory Management
- Chapter 6: Attribute Management of Regular Files, Link Files, and Directory Files
- Chapter 7: Terminal and Serial Port Programming
- Chapter 8: Linux Process Management and Program Development
- Chapter 9: Interprocess Communication—Pipes
- Chapter 10: Linux Asynchronous Signal Handling Mechanisms
- Chapter 11: System V Interprocess Communication
- Chapter 12: Linux Multithreaded Programming
- Chapter 13: Fundamentals of Linux Socket Network Programming
- Chapter 14: Advanced TCP Applications
- Chapter 15: UDP Network Programming Applications
- Chapter 16: Network Server Application Design
- Chapter 17: Local Communication and Raw Sockets
- Chapter 18: Fundamentals of Audio Application Development
FAQ
这本书适合零基础学Linux的人吗?
不太适合。书中默认读者已经会写C、会用命令行、看得懂简单的Makefile,一上来就讲系统调用。建议先用一本Linux入门书把shell和常用命令练熟,再回来看这本。这本书讲内核开发还是应用开发?
讲应用层的Linux系统编程,也就是在用户态调用系统接口写程序,不涉及内核模块与驱动开发。书中讨论的“进程管理资源”是从用户程序视角出发的。第3版和之前版本有什么差别?
该书第1版2008年出版,第2版2009年出版,第3版2012年出版,页数与篇幅逐版增加。第3版补充了终端编程、原始套接口、网络服务器应用设计和音频应用开发等内容,结构也更完整。书里的例子能用在新版发行版上吗?
大部分可以,但书中环境以较老的Linux内核与GCC 4.0、GDB 6.3为基准。在新版GCC下可能遇到警告或默认标准变化,按报错提示调整编译选项通常即可通过。读完这本之后接什么书比较好?
可以继续读《UNIX环境高级编程》(APUE)做系统性补全,或转向《Linux多线程服务端编程》《UNIX网络编程》深入并发与网络方向,也可以直接读内核相关书籍。This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.
About the author
Yang Zongde AuthorYang Zongde is a computer book author about whom relatively limited information is available; his nationality, dates of birth and death, and personal background are not clearly documented in public sources. Two of his works can currently be identified, both centered on the Linux system: Linux Advanced Programming (3rd Edition), which explains programming in the Linux environment for readers who already have a foundation, and Linux from Beginner to Proficiency (Volume 1) (3-volume set), which covers a learning path from introductory to advanced material in separate volumes. Judging from these works, his writing focuses on operating systems and programming design, commonly classified under computers, programming design, and software learning, and emphasizes practical, step-by-step explanation suited to technical learners at different stages.
Lü Guanghong AuthorLü Guanghong is an author of computer technology books. Public information about him is limited, and his dates of birth and death, nationality, and professional background are not clearly documented. Judging from the two works held in the collection, his writing focuses on Linux systems and programming. His representative titles include Advanced Linux Programming (3rd Edition) and Linux from Beginner to Proficiency (Volume 1) (a three-volume set). The former is aimed at readers with some foundation and explains advanced programming methods in the Linux environment in depth, while the latter starts from the basics and guides readers step by step through system use and development skills. The two works form a progression from introductory to advanced material, serving both beginners and more advanced learners. The content emphasizes hands-on practice and the development of programming ability, and is usually classified under computing, programming design, and software learning. Overall, his writing stresses graded, practical knowledge and offers a useful reference among Linux study materials.
Liu Yong AuthorLiu Yong is an author of books on computer technology, though publicly available information about him is currently limited: his year of birth, place of origin, education, and professional career are not clearly documented. According to the available catalog information, one work by him is held in the collection, Linux Advanced Programming (3rd Edition), classified under computing and programming design. The book focuses on advanced programming in the Linux environment and is intended for developers who already have some foundation, covering topics such as system programming and development practice. His writing on this subject tends to combine technical principles with engineering application, serving practical development needs and offering useful reference for readers who wish to gain a deeper understanding of Linux programming. Because verifiable material is scarce, a fuller picture of his work and writing style awaits further titles and information.