I have created an object in which there is a specific method for processing different types of incidents and until my application runs No longer remains. I also created separate representatives pointing to each representative and they were referenced in the X number of threads. Pointing to the given y and z threads, method 1 will be applied using a delegate, before waiting for y threads before they can use method1. Or can they start it together?
Unless you are working on locking or any other type of mutation, each thread is representative Will call back the method in parallel. They will not wait for each other.
This is where thread-safety comes in the game. There is no natural bad about two different threads about executing a method at the same time, but if this method touches the examples of its owner class, and these threads work together with the same example at the same time So, you take the risk of collisions and bugs in threads, from fatal errors to strange, subtle, and difficult-to-be-recreated behaviors. My rule of thumb is that yarn is not found and when I can escape from it.
Comments
Post a Comment