私は問題を解決しようとしています.これが実現可能かどうかにかかわらず、このフォーラムの専門家と理解しようとしていません.問題は、Javaを使用したスレッド間通信にあります.
私はクラスを持っています:
class A {
public void setX() {}
public void setY() {}
}
たとえば、4 つ以上のスレッドがあります。
T1,T2,T3,T4 are the threads that operates on this Class
スレッドが 1 つのメソッドを設定している場合、他のすべてのスレッドが他のメソッドで動作するように同期を設計する必要があります。
例えば:
if thread T1 is operating on setX() methods then T2,T3,T4 can work on setY()
if thread T2 is operating on setX() methods then T1,T3,T4 can work on setY()
if thread T3 is operating on setX() methods then T1,T2,T4 can work on setY()
if thread T4 is operating on setX() methods then T1,T2,T3 can work on setY()