Multithreading batch job in Microsoft Dynamics 365 Finance and Operations

The multithreading batch job is used to break large/time-consuming batches into smaller pieces in Microsoft Dynamics 365 Finance and Operations.

We have 3 different Approaches for Multithreading:

  1. Individual Task Modeling
  2. Batch Bundling
  3. Top Picking

I will take an example of a kitchen in a restaurant to explain the three types of multithreading in Microsoft Dynamics 365 Finance and Operation batch jobs.

1. Individual Task Modeling: ๐ŸŸข
In this type of Multithreading, Consider each dish that a customer orders as a task/work item. Using this method, one chef is tasked with preparing one meal at a time. This works effectively when there aren’t many meals to prepare because each chef can concentrate on one dish without becoming overworked. Having a chef for every dish can cause chaos in the kitchen if the restaurant is extremely busy, as there will be too many chefs working at once. As shown in the picture below.

Individual Task Modeling
Individual Task Modeling

2. Batch Bundling: ๐ŸŸข๐ŸŸข
In this type of Multithreading, we combine multiple dishes into a batch and give it to the chef to prepare. For instance, one chef might be in charge of preparing all of the appetizers, another, all of the main dishes, and so on. Things can become more structured as a result, but the issue comes when one batch takes significantly longer to prepare than the others. In this scenario, some cooks can be waiting while others continue to work on their batches. As shown in the picture below.

Batch Bundling
Batch Bundling

3. Top Picking: ๐ŸŸข๐ŸŸข๐ŸŸข
In this type of Multithreading, There are no pre-assigned dishes or batches for the chefs here. Instead, as soon as they have some free time, they cook the next meal on the order list. Because they start working on the next dish as soon as they finish with the previous one, this keeps all of the cooks busy and shortens wait times. There is a constant flow of food being prepared and served with this method. As shown in the picture below.

Top Picking
Top Picking

Now for the code, you can refer to Multithreading in D365 Batch Jobs

Need help? Connect Atul

Atul Yadav
Latest posts by Atul Yadav (see all)

1 Comment

  1. Nazim Akhtar

    Informative๐Ÿ‘๐Ÿผ๐Ÿ‘๐Ÿผ

Leave a Reply

Your email address will not be published. Required fields are marked *