Thread Sanitizer in iOS

Updated 30 November 2022

Save

Before starting with Thread Sanitizer. We need to know the concept of a data race.

A data race is accessing the same address from two different threads at the same time.

This is also known as Race condition.

If the above condition occurs there will different types of errors occur Like crashes etc.

Simulate

For better understanding, we need to simulate a race condition.

Please check the below image to enable the thread simulator in project

For example in the view controller without a data race condition

After adding race condition and without ThreadSanitizer

Example in which data race condition occurs and thread sanitizer enabled

Conclusion

We can simply prevent our application from crashed-like conditions by using the above concept in the application.

I hope this blog helps you to understand the functionality of Thread Sanitizer concept.

Thanks for Reading !!

author
. . .

Leave a Comment

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


Be the first to comment.

Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home