web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

When the multithreading useful to used in D365FO

(0) ShareShare
ReportReport
Posted on by 716

Hi team,

I little bit know about multithreading. Please let me know, when it's exactly useful to used? How it's worked in real world. Is there any setup required?

Pls advise, thanks 

Categories:
I have the same question (0)
  • Suggested answer
    Navneeth Nagrajan Profile Picture
    2,665 Super User 2026 Season 2 on at

    Hi @CU10121822-0,

    Multi-threading means splitting a long-running or a batch task into parallel tasks (threads) so that multiple processes of a business process run simultaneously and reduce the total execution time. Instead of one large job handling the entire business process the system uses multiple smaller threads to process data in chunks. 

    Purpose:
    - Processing large volumes of data (Vendor payment journals, customer invoice journals, sales order invoicing, inventory closing etc.)
    - Parallel processing and performance critical operations.
    Advantages are you can define the number of threads/parallel tasks required to process the multi-threaded jobs too. Combine multi-threading with batch priority scheduling for month-end and year-end heavy workload tasks. 

    A classic example of this is the posting approved journals. Would recommend referring to this class LedgerJournalMultiPost

    Hope this helps. Happy to answer questions, if any.

  • CU10121822-0 Profile Picture
    716 on at

    Thanks Navneeth well explained…

    I like to do practically to understand well with custom batch job using multithreading 

    Could you please guide me from scratch with the class and setup if required. I mean where to define the number of threads and how will I executed this.

     

    I have gone through and what I understood…

    Suppose I have journals like J1,J2,J3,J4,J5,J6,J7

     

                    Journal Queue…
          J1 J2 J3 J4 J5 J6 J7 
         Batch task - J1, J3,J5

         Batch task - J2,J6

         Batch task - J7,J4

    A batch task finishes one journal and then picks another journal from the queue.This gives much better workload balancing.

    Am I correct?

    Pls advise, thanks.

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    306,686 Super User 2026 Season 2 on at

    Hi,

    There are examples of multi-threaded batch jobs in the standard application. Some are creating tasks based on a bundle size, like SysWorkflowMessageQueueManager. This is taking 100 workflow instances per task. The number of tasks depends on the load. 

    The inventory closing is looking at a parameter for the number of tasks.

    This is managed in the class InventCostTaskController.

     

    What to use depends on expected system load. From my experience, I have seen about 800-1000 workflow messages running simultaneously as a maximum. This means that there would be 8-10 tasks created to run in parallel. 

    Organizations with a huge load on inventory transactions should consider running the inventory closing in non-business hours, but they can't use 100 threads. That would then consume all available batch threads for that reason, the number of maximum tasks is defined in a parameter. 

    Please check the mentioned classes for code examples.

  • Suggested answer
    vishalsahijwani Profile Picture
    343 on at

    Hi @CU10121822-0  , 

    The main purpose of Multithreading in D365 F&O is to divide a hige complex task into smaller non dependent tasks and process them parallelly to reduce the processing time thereby enhancing the performance of the whole process.

    Let us understand this through a real world example - A custom process which contains 100 records which usually takes 8 hours to process. If we break this into 8 parallel threads it takes 1 hour 6 minutes.

    If you want to check a working code in X++ for Multithreading in D365 F&O I have published the same on my blog. Please check the link mentioned below : - 

    Dynamics 365 Fin Ops Code Base: Implementation of Multithreading in D365 F&O through X++

    Please check if this helps.

  • Suggested answer
    Deepak Agarwal Profile Picture
    9,226 Super User 2026 Season 2 on at

    @CU10121822-0  you are nearly there. what you described is actually the Top Picking Pattern, which Microsoft now recommends for uneven workloads; each batch task processes a work item and then immediately picks up the next available work item from a queue, resulting in better workload balancing and performance. 

     

    While the assignment is dynamic not predetermined(if your example meant that). For step to step guidance that varies case by case. Pl refer the examples shared by others. 

     

    For more details pl refer lean documentations here Batch parallelism and multi-threading in Dynamics 365 finance and operations apps - Finance & Operations | Dynamics 365 | Microsoft Learn

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 284 Super User 2026 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 258 Most Valuable Professional

#3
Anton Venter Profile Picture

Anton Venter 228 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans