正在加载图片...
CONTENTS xi进 Advanced thread management 273 9.1 Thread pools 274 The simplest possible thread pool 274"Waiting for tasks submitted to a thread pool 276"Tasks that wait for other tasks 280 Avoiding contention on the work queue 283 Work stealing 284 9.2 Interrupting threads 289 Launching and interrupting another thread 289.Detecting that a thread has been interrupted 291"Interrupting a condition variable wait 291 Interrupting a wait on std::condition_variable any 294"Interrupting other blocking calls 296 Handling interruptions 297 Interrupting background tasks on application exit 298 9.3 Summary 299 10 Testing and debugging multithreaded applications 300 10.1 Types of concurrency-related bugs 301 Unwanted blocking 301 Race conditions 302 10.2 Techniques for locating concurrency-related bugs 303 Reviewing code to locate potential bugs 303 Locating concurrency-related bugs by testing 305 Designing for testability 307"Multithreaded testing techniques 308 Structuring multithreaded test code 311 Testing the performance of multithreaded code 314 10.3 Summary 314 appendix A Brief reference for some C++11 language features 315 appendix B Brief comparison of concurrency libraries 340 appendix C A message-passing framework and complete ATM example 342 appendix D C++Thread Library reference 360 resources 487 index 489CONTENTS xiii 9 Advanced thread management 273 9.1 Thread pools 274 The simplest possible thread pool 274 ■ Waiting for tasks submitted to a thread pool 276 ■ Tasks that wait for other tasks 280 ■ Avoiding contention on the work queue 283 Work stealing 284 9.2 Interrupting threads 289 Launching and interrupting another thread 289 ■ Detecting that a thread has been interrupted 291 ■ Interrupting a condition variable wait 291 ■ Interrupting a wait on std::condition_variable_any 294 ■ Interrupting other blocking calls 296 ■ Handling interruptions 297 Interrupting background tasks on application exit 298 9.3 Summary 299 10 Testing and debugging multithreaded applications 300 10.1 Types of concurrency-related bugs 301 Unwanted blocking 301 ■ Race conditions 302 10.2 Techniques for locating concurrency-related bugs 303 Reviewing code to locate potential bugs 303 Locating concurrency-related bugs by testing 305 Designing for testability 307 ■ Multithreaded testing techniques 308 ■ Structuring multithreaded test code 311 Testing the performance of multithreaded code 314 10.3 Summary 314 appendix A Brief reference for some C++11 language features 315 appendix B Brief comparison of concurrency libraries 340 appendix C A message-passing framework and complete ATM example 342 appendix D C++ Thread Library reference 360 resources 487 index 489
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有