O'Reilly logo

C++ Multithreading Cookbook by Milos Ljumovic

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding process and thread priority

To be able to work with threads, you need to know more than just how to create or terminate a thread. It's required that threads interact effectively, which demands proper time control. Time control has two forms: priority and synchronization. Priority controls how often a thread gets the CPU for execution, while synchronization controls thread competition for shared resources, and gives the sequence where threads must perform tasks in a specific order.

When one thread finishes, the scheduler looks for the next thread that will be executed. While selecting the next thread, the threads with higher priority have an advantage. Some activities such as response to sudden power loss are always executed with higher ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required