Is Field public void set(Object obj, Object value) thread-safe when using Java reflection? If it's not thread-safe, how can the atomicity of set be ensured?
Write rarely and read frequently, reads and writes are not in the same place, so it's not convenient to use synchronized access.
You can use VarHandle to perform finer-grained access to a variable than with default reflection.
You can also manually create load/store/full fences. Prerequisites are: understanding the Java Memory Model and concurrency in general.