Friday, June 13, 2014

Third edition in the works

We've gotten started on the third edition of CS:APP.  The biggest change will be that we will shift entirely to 64 bits.  It seems like that shift has finally occurred across most systems, and so we can say goodbye to 32-bit systems.

Here's a summary of the planned changes for each chapter.
  1. Introduction.  Minor revisions.  Move the discussion of Amdahl's Law to here, since it applies across many aspects of computer systems
  2. Data.  Do some tuning to improve the presentation, without diminishing the core content.  Present fixed word size data types.
  3. Machine code.  A complete rewrite, using x86-64 as the machine language, rather than IA32.  Also update examples based on more a recent version of GCC (4.8.1).  Thankfully, GCC has introduced a new opimization level, specified with the command-line option `-Og' that provides a fairly direct mapping between the C and assembly code.  We will provide a web aside describing IA32.
  4. Architecture.  Shift from Y86 to y86-64.  This includes having 15 registers (omitting %r15 simplifies instruction encoding.), and all data and addresses being 64 bits.  Also update all of the code examples to following the x86-64 ABI conventions.
  5. Optimization.  All examples will be updated (they're mostly x86-64 already).
  6. Memory Hierarchy.  Updated to reflect more recent technology.
  7. Linking.  Rewritten for x86-64.  We've also expanded the discussion of using the GOT and PLT to create position-independent code, and added a new section on the very cool technique of library interpositioning.
  8. Exceptional Control Flow.  More rigorous treatment of signal handlers, including async-signal-safe functions, specific guidelines for writing signal handlers, and using sigsuspend to wait for handlers.
  9. VM.  Minor revisions.
  10. System-Level I/O.  Added a new section on files and the file hierarchy.
  11. Network programming.  Protocol-independent and thread-safe sockets programming using the modern getaddrinfo and getnameinfo functions, replacing the obsolete and non-reentrant gethostbyname and gethostbyaddr functions.
  12. Concurrent programming.  Enhanced coverage of performance aspects of parallel multicore programs.
The new edition will be available March, 2015.

22 comments:

  1. Is there any instruction on x64 in the earlier edition or do you advise I wait for the new? I don't want to go backwards to go forwards -- Also, your book comes highly recommended. But my main focus is moving forward as much as possoble -- So I just don't know. Thank you for yoir time.

    ReplyDelete
    Replies
    1. Yes. The second edition covers x86-64, but it does so by first presenting IA32 and then describing how x86-64 changes things. This time around, we're starting from x86-64. We'll have a separate Web Aside on IA32.

      The main point is: you don't need to wait for the third edition to learn x86-64!

      Delete
  2. Thank you for your reply.
    I've also noticed a deficiency in reference material and tutorials on assembly programming for windows. I found a certain book useful for linux and unix-like (Introduction to 64 Bit Assembly Language Programming for Linux and OS X by
    Ray Seyfarth). Do you think you guys will touch on Windows and maybe the differences? Again-- thank you for your time.

    ReplyDelete
  3. Sorry, but we don't have any plans to do a Windows version. Our goal with the book is to present a comprehensive view of a single platform, including hardware, operating system, and associated tools. x86-64 + Linux is the platform we've chosen. x86-64 + Windows would be very different, both in terms of assembly code format and in terms of the handling of processes, signals, etc.

    ReplyDelete
  4. Please make it possible to buy the 3rd edition in ePub format. I will be the first to buy. It is really hard to copy-paste source code from a book in the Kindle format, plus there is no Kindle for Linux, although Kindle PC runs in Wine...

    ReplyDelete
  5. Will you include a discussion of embedded architecture i.e. ARM?

    ReplyDelete
    Replies
    1. No. Our goal is to give complete coverage to a single platform, including hardware, compiler, and OS, rather than a broad survey of many different machines. Doing justice to an ARM platform would require an entire book of its own.

      Delete
  6. Dr Bryant,

    Do you have any plans for writing any book on virtualization? It would be great to have a book that covers hypervisor design/implementation and its integration with guess OS.

    ReplyDelete
    Replies
    1. No, we don't have any plans in the works to write a book about virtualization. You might be interested in checking out the classic text in this area: James E Smith and Ravi Nair, "Virtual Machines", Morgan Kaufmann, 2005.

      Delete
  7. Dr.Byant, Will there be a digital edition for the 3rd edition?

    ReplyDelete
    Replies
    1. We're trying to figure that out. Somehow it's become very easy to get pirated copies of the 2nd edition, and we don't want to have that happen with the 3rd edition. We need to make sure there are strong DRM protections on any electronic version.

      Delete
    2. Dr Bryant - Request you to consider electronic versions also be made available in some form of perpetual DRM license. The 2nd edition was made available for rent as a textbook online for 6-month, but it is not an attractive option for professionals who use the book as a reference.

      Delete
    3. Dr Bryant,

      Pirated copies will be released regardless. Your book is also likely targeted at people who are against DRM and care about open formats.

      I sympathise with your predicament but perhaps you could look at how O'Reilly handles this situation. Tim O'Reilly said "People who don't pay you generally wouldn't have paid you anyway".

      Delete
  8. Thank you Prof. Bryant for writing such an outstanding textbook. I was planning on using the 2nd edition for self-study but I will wait for the 3rd edition as it appears to be a major update. Do you plan on offering new self-study labs as well? Thank you.

    ReplyDelete
    Replies
    1. We currently have self-study labs for the 2nd edition:

      http://csapp.cs.cmu.edu/public/labs.html

      We will update these to match the coverage of the 3rd edition.

      Delete
  9. Looking at the web asides for the current edition, SIMD appears to be not covered in the actual book (sorry if this is wrong), how will it be covered (and which variants AVX?) in the upcoming edition?

    ReplyDelete
    Replies
    1. We don't say much about SIMD in the text itself, but we do have a web aside on the subject. The version (based on SSE2) for the second edition is available at:

      http://csapp.cs.cmu.edu/public/waside/waside-simd.pdf

      We'll have an updated version for the third edition based in AVX2. The results are very compelling

      Delete
  10. And just now I've bought the second edition. :/ Well, I guess it doesn't matter at this point - depending on how things go I might as well just buy the 3rd addition sometime in future (preferably a month prior to the 4th edition's release :( ).

    Anyway, I can't wait to dive into this. What I hope for is, that by the time I've finished this book, my programming skills will have climbed up by a few levels. Looking forward to it.

    ReplyDelete
  11. For people already owning the 2nd edition, would it be worth it to get the latest version instead? Alternatively, will there be some material available through an online source that could be used side-by-side with the 2nd edition to see how and where exactly the text has changed?

    ReplyDelete
    Replies
    1. It's up to you, but the third edition really does cover some new ground. The coverage of x86-64 is much more comprehensive.

      Delete
  12. Dr Bryant,

    Thank you for writing this amazing book. I have off-subject question. What does that picture mean on the book?

    ReplyDelete
  13. All 3 editions have featured a graphic representation of the memory performance for different models of Intel processors. We refer to this as the "memory mountain." It's described in Ch. 6.

    ReplyDelete