stephansun对《Java Concurrency in Practice》的笔记(4)

stephansun (认真你就输了...)

在读 Java Concurrency in Practice

Java Concurrency in Practice
  • 书名: Java Concurrency in Practice
  • 作者: Brian Goetz/Tim Peierls/Joshua Bloch/Joseph Bowbeer/David Holmes/Doug Lea
  • 页数: 384
  • 出版社: Addison-Wesley Professional
  • 出版年: 2006-5-19
  • 序言
    Our goal is to give readers a set of design rules and mental models that make it easier—and more fun—to build correct, performant concurrent classes and applications in Java.
    引自 序言

    Martin Buchholz资深Java维护人员,将java.util.concurrency带进JDK。

    2011-10-31 20:31:52 回应
  • 第2页
    Threads are sometimes called lightweight processes, and most modern operating systems treat threads, not processes, as the basic units of scheduling.
    2011-10-31 20:39:23 回应
  • 第3页
    Using multiple threads can also help achieve better throughput on singleprocessor systems. If a program is single-threaded, the processor remains idle while it waits for a synchronous I/O operation to complete. In a multithreaded program, another thread can still run while the first thread is waiting for the I/O to complete, allowing the application to still make progress during the blocking I/O. (This is like reading the newspaper while waiting for the water to boil, rather than waiting for the water to boil before starting to read.)


    2011-10-31 20:44:11 回应
  • 第4页


    Historically, operating systems placed relatively low limits on the number of threads that a process could create, as few as several hundred (or even less). As a result, operating systems developed efficient facilities for multiplexed I/O, such as the Unix select and poll system calls, and to access these facilities, the Java class libraries acquired a set of packages (java.nio) for nonblocking I/O. However, operating system support for larger numbers of threads has improved significantly, making the thread-per-client model practical even for large numbers of clients on some platforms.


    2011-10-31 20:51:18 回应