Book Image

C++ Multithreading Cookbook

By : Miloš Ljumović
Book Image

C++ Multithreading Cookbook

By: Miloš Ljumović

Overview of this book

<p>Creating multithreaded applications is a present-day approach towards programming. With the power of C++, you can easily create various types of applications and perform parallelism and optimizations in your existing work. This book is a practical, powerful, and easy-to-understand guide to C++ multithreading. You will learn how to benefit from the multithreaded approach and enhance your development skills to build better applications. This book will not only help you avoid problems when creating parallel code, but also help you to understand synchronization techniques. The end goal of the book will be to impart various multithreading concepts that will enable you to do parallel computing and concurrent programming quickly and efficiently.</p>
Table of Contents (17 chapters)
C++ Multithreading Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Introduction


Modern computers can do several things at the same time. Windows users are not fully aware of this, so let's give an example that will illustrate things more closely. When the PC system is booted, many processes that are hidden from the user are started. For example, a process that manages incoming e-mails, a process in charge of obtaining latest antivirus definitions, and so on. Explicit user processes may also be running: printing files, or burning CDs, all while the user is performing some other tasks such as surfing the Web. Activities such as these must be managed, and a multitasking system, which supports multiple processes, can be very handy here. In such a multitasking system, the CPU switches between processes quickly, running each process for a few milliseconds. Strictly speaking, at any instant of time, the CPU is running only one process by switching quickly among processes—giving the illusion of parallelism.

Operating systems over the years have evolved to a sequential...