Understanding granularity

When there is one common computational task inside your application, it is quite obvious how to make it run in parallel. The most effective solution would be to divide the tasks in parts and run these parts on each available CPU core. Since the number of parts will not be large, there will not be any significant performance overhead. This way of dividing your code into parallel running tasks is called coarse-grained:

Understanding granularity

There is one problem with the coarse-grained approach. The large tasks can run at significantly different times, and then at these times, some of the CPU cores will not be used to help compute the other tasks. ...

Get Mastering C# Concurrency now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.