Tips
- In each class, lock every public methods and any methods triggered by event from other classes.
- For each methods, lock the entire code from start until the end of method by default. Reducing the lock coverage to only certain part of code in a method can be done carefully after this as an optimization.
- Triggering event should not be performed from inside a lock.
No comments:
Post a Comment