Skip to main content

Notifications

Announcements

No record found.

Service | Customer Service, Contact Center, Fie...
Suggested answer

What is the function of DisableCrossThreadSafeties? Is there any risk if it is set to true or false

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a concurrent program to request crm, and then I found that the DisableCrossThreadSafeties property setting of CrmServiceClient supports concurrency, and found that setting it to true increases the concurrency efficiency by 50%. Is there any risk to crm or thread safety issues?

CrmServiceClient svc = new CrmServiceClient(ConfigurationManager.AppSettings["ConnStr"]);
svc.DisableCrossThreadSafeties = true;

Set to false: the total time-consuming program runs to completion, time-consuming: 164930 list count: 320 average each millisecond: 515

Set to true Total time-consuming program to run to completion, time-consuming: 79941 list count: 320 average each millisecond: 249

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: What is the function of DisableCrossThreadSafeties? Is there any risk if it is set to true or false

    Hi,

    CrmServiceClient itself is thread safe, but if you use DisableCrossThreadSafeties, it will cause thread safety issues.

    You can refer to the official API documentation, here is a very clear statement:

    CrmServiceClient.DisableCrossThreadSafeties Property (Microsoft.Xrm.Tooling.Connector) | Microsoft Docs

    pastedimage1627522507237v1.jpeg

    If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.

    Best Regards,

    Frank Gong

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,431 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,503 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans