没有合适的资源?快使用搜索试试~ 我知道了~
Java Threads英文第三版
5星 · 超过95%的资源 需积分: 10 96 下载量 9 浏览量
2013-02-20
09:00:38
上传
评论 2
收藏 2.16MB PDF 举报
温馨提示
试读
520页
这本技术书,秉承了该著名出版社的一贯风格,把需要澄清的概念和 细节 明白无误的展示在眼前。内容虽多但不难读。
资源推荐
资源详情
资源评论
Java Threads, Third Edition
Java Threads, Third Edition
1
Table Of Contents
1. Java Threads, Third Edition .............................................................................................................. 5
2. Table of Contents ............................................................................................................................. 5
3. Copyright ......................................................................................................................................... 8
4. Preface ............................................................................................................................................. 9
4.1 Who Should Read This Book? .............................................................................................. 10
4.2 Versions Used in This Book .................................................................................................. 10
4.3 What's New in This Edition? ................................................................................................ 11
4.4 Organization of This Book .................................................................................................... 13
4.5 Conventions Used in This Book ............................................................................................ 15
4.6 Code Examples ..................................................................................................................... 16
4.7 How to Contact Us ............................................................................................................... 16
4.8 Safari Enabled ...................................................................................................................... 17
4.9 Acknowledgments ............................................................................................................... 17
5. Chapter 1. Introduction to Threads ............................................................................................... 18
5.1 1.1 Java Terms ...................................................................................................................... 18
5.2 1.2 About the Examples ....................................................................................................... 21
5.3 1.3 Why Threads? ................................................................................................................ 24
5.4 1.4 Summary ........................................................................................................................ 28
6. Chapter 2. Thread Creation and Management .............................................................................. 29
6.1 2.1 What Is a Thread? .......................................................................................................... 29
6.2 2.2 Creating a Thread ........................................................................................................... 33
6.3 2.3 The Lifecycle of a Thread ............................................................................................... 48
6.4 2.4 Two Approaches to Stopping a Thread .......................................................................... 53
6.5 2.5 The Runnable Interface .................................................................................................. 58
6.6 2.6 Threads and Objects ...................................................................................................... 65
6.7 2.7 Summary ........................................................................................................................ 67
7. Chapter 3. Data Synchronization ................................................................................................... 69
7.1 3.1 The Synchronized Keyword ............................................................................................ 69
7.2 3.2 The Volatile Keyword ..................................................................................................... 73
7.3 3.3 More on Race Conditions .............................................................................................. 76
7.4 3.4 Explicit Locking ............................................................................................................... 84
7.5 3.5 Lock Scope ..................................................................................................................... 89
7.6 3.6 Choosing a Locking Mechanism ..................................................................................... 94
7.7 3.7 Nested Locks .................................................................................................................. 96
7.8 3.8 Deadlock ...................................................................................................................... 100
7.9 3.9 Lock Fairness ................................................................................................................ 109
7.10 3.10 Summary .................................................................................................................. 111
8. Chapter 4. Thread Notification .................................................................................................... 112
8.1 4.1 Wait and Notify ............................................................................................................ 113
8.2 4.2 Condition Variables ...................................................................................................... 123
Java Threads, Third Edition
2
8.3 4.3 Summary ...................................................................................................................... 128
9. Chapter 5. Minimal Synchronization Techniques......................................................................... 129
9.1 5.1 Can You Avoid Synchronization? .................................................................................. 130
9.2 5.2 Atomic Variables .......................................................................................................... 136
9.3 5.3 Thread Local Variables ................................................................................................. 168
9.4 5.4 Summary ...................................................................................................................... 171
10. Chapter 6. Advanced Synchronization Topics ............................................................................ 172
10.1 6.1 Synchronization Terms ............................................................................................... 173
10.2 6.2 Synchronization Classes Added in J2SE 5.0 ................................................................ 174
10.3 6.3 Preventing Deadlock .................................................................................................. 182
10.4 6.4 Deadlock Detection ................................................................................................... 190
10.5 6.5 Lock Starvation .......................................................................................................... 211
10.6 6.6 Summary .................................................................................................................... 216
11. Chapter 7. Threads and Swing ................................................................................................... 217
11.1 7.1 Swing Threading Restrictions ..................................................................................... 217
11.2 7.2 Processing on the Event-Dispatching Thread ............................................................ 218
11.3 7.3 Using invokeLater( ) and invokeAndWait( ) ................................................................ 219
11.4 7.4 Long-Running Event Callbacks ................................................................................... 222
11.5 7.5 Summary .................................................................................................................... 227
12. Chapter 8. Threads and Collection Classes ................................................................................ 228
12.1 8.1 Overview of Collection Classes .................................................................................. 229
12.2 8.2 Synchronization and Collection Classes ..................................................................... 234
12.3 8.3 The Producer/Consumer Pattern ............................................................................... 245
12.4 8.4 Using the Collection Classes ...................................................................................... 249
12.5 8.5 Summary .................................................................................................................... 250
13. Chapter 9. Thread Scheduling .................................................................................................... 251
13.1 9.1 An Overview of Thread Scheduling ............................................................................ 252
13.2 9.2 Scheduling with Thread Priorities .............................................................................. 262
13.3 9.3 Popular Threading Implementations ......................................................................... 264
13.4 9.4 Summary .................................................................................................................... 272
14. Chapter 10. Thread Pools .......................................................................................................... 273
14.1 10.1 Why Thread Pools? .................................................................................................. 273
14.2 10.2 Executors ................................................................................................................. 277
14.3 10.3 Using a Thread Pool ................................................................................................. 279
14.4 10.4 Queues and Sizes ..................................................................................................... 282
14.5 10.5 Thread Creation ....................................................................................................... 287
14.6 10.6 Callable Tasks and Future Results ............................................................................ 288
14.7 10.7 Single-Threaded Access ........................................................................................... 291
14.8 10.8 Summary .................................................................................................................. 293
15. Chapter 11. Task Scheduling ...................................................................................................... 294
15.1 11.1 Overview of Task Scheduling ................................................................................... 295
15.2 11.2 The java.util.Timer Class .......................................................................................... 296
15.3 11.3 The javax.swing.Timer Class ..................................................................................... 307
15.4 11.4 The ScheduledThreadPoolExecutor Class ................................................................ 312
Java Threads, Third Edition
3
15.5 11.5 Summary .................................................................................................................. 322
16. Chapter 12. Threads and I/O ..................................................................................................... 324
16.1 12.1 A Traditional I/O Server ........................................................................................... 325
16.2 12.2 A New I/O Server ..................................................................................................... 343
16.3 12.3 Interrupted I/O ........................................................................................................ 360
16.4 12.4 Summary .................................................................................................................. 365
17. Chapter 13. Miscellaneous Thread Topics ................................................................................. 367
17.1 13.1 Thread Groups ......................................................................................................... 367
17.2 13.2 Threads and Java Security ........................................................................................ 369
17.3 13.3 Daemon Threads ...................................................................................................... 372
17.4 13.4 Threads and Class Loading ....................................................................................... 373
17.5 13.5 Threads and Exception Handling ............................................................................. 374
17.6 13.6 Threads, Stacks, and Memory Usage ....................................................................... 379
17.7 13.7 Summary .................................................................................................................. 384
18. Chapter 14. Thread Performance .............................................................................................. 384
18.1 14.1 Overview of Performance ........................................................................................ 385
18.2 14.2 Synchronized Collections ......................................................................................... 387
18.3 14.3 Atomic Variables and Contended Synchronization .................................................. 389
18.4 14.4 Thread Creation and Thread Pools .......................................................................... 391
18.5 14.5 Summary .................................................................................................................. 392
19. Chapter 15. Parallelizing Loops for Multiprocessor Machines .................................................. 393
19.1 15.1 Parallelizing a Single-Threaded Program ................................................................. 394
19.2 15.2 Multiprocessor Scaling ............................................................................................. 437
19.3 15.3 Summary .................................................................................................................. 456
20. Appendix A. Superseded Threading Utilities ............................................................................. 458
20.1 A.1 The BusyFlag Class ..................................................................................................... 459
20.2 A.2 The CondVar Class ..................................................................................................... 461
20.3 A.3 The Barrier Class ........................................................................................................ 467
20.4 A.4 The RWLock Class ...................................................................................................... 469
20.5 A.5 The ThreadPool Class................................................................................................. 475
20.6 A.6 The JobScheduler Class ............................................................................................. 482
20.7 A.7 Summary ................................................................................................................... 492
21. Colophon ................................................................................................................................... 493
22. Index .......................................................................................................................................... 494
22.1 index_A ............................................................................................................................ 494
22.2 index_B ............................................................................................................................ 495
22.3 index_C ............................................................................................................................ 496
22.4 index_D ............................................................................................................................ 498
22.5 index_E ............................................................................................................................ 498
22.6 index_F ............................................................................................................................ 499
22.7 index_G ............................................................................................................................ 500
22.8 index_H ............................................................................................................................ 500
22.9 index_I ............................................................................................................................. 501
22.10 index_J ........................................................................................................................... 502
Java Threads, Third Edition
4
22.11 index_K .......................................................................................................................... 503
22.12 index_L ........................................................................................................................... 503
22.13 index_M ......................................................................................................................... 505
22.14 index_N .......................................................................................................................... 509
22.15 index_O .......................................................................................................................... 509
22.16 index_P .......................................................................................................................... 510
22.17 index_Q .......................................................................................................................... 511
22.18 index_R .......................................................................................................................... 511
22.19 index_S .......................................................................................................................... 512
22.20 index_T .......................................................................................................................... 515
22.21 index_U .......................................................................................................................... 517
22.22 index_V .......................................................................................................................... 518
22.23 index_W ......................................................................................................................... 519
剩余519页未读,继续阅读
资源评论
- 仕兴2018-01-20下载看看!!!!
- baidu_292049592015-07-22经典,很清晰
- 睡不够的kira2015-04-18一本系统介绍thread方面的有关知识
listeven
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Windows 常见运行运行库32+64
- 基于3KW光伏并网单相逆变器设计(TMS320F28035控制板+显示板+STM32F103功率板)硬件(原理图+PCB)工程
- 正点原子HAL库 STM32F4 外部中断(学习自用附源码)
- delphi rzcombobox DropDownList 灰色背景改为白色
- sap sd.docsap sd.doc
- torch-1.10.2-cp38-cp38-win-amd64.whl
- 菜单栏实现增加数据,修改数据,查询数据,删除数据
- 全国省市区三级联动json文件,带code
- C8_全局&局部&static.zip
- Unity和安卓交互插件Unity调Android Native Goodies PRO
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功