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:
- Individual Task Modeling
- Batch Bundling
- 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.
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.
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.
Now for the code, you can refer to Multithreading in D365 Batch Jobs
Need help? Connect Atul
- D365 Data entitiy Insert method COC - October 30, 2024
- D365 Joins - October 16, 2024
- D365 Find method and Exist method - October 9, 2024
Informative๐๐ผ๐๐ผ