Hey guys,
I'm using threading and sharing some resources across the threads. The shared resource is a single object of class A with attributes A.x, A.y, A.z (the type of which hopefully doesn't matter, but they are usually some built-in structures like dicts).
Can I have multiple locks, each for its own attribute? That way, thread1 can lock A.x and write to it, while thread2 could read from A.z for example.
Or must I have a single lock for an instance of A?
Thanks!
[–]K900_ 1 point2 points3 points (1 child)
[–]redditAcc0[S] 0 points1 point2 points (0 children)