<div dir="ltr"><div style="color:rgb(0,0,0);font-family:Arial;font-size:14px;margin:0px">I have a question about using MemorySegment with Arena.openShared().</div><div style="color:rgb(0,0,0);font-family:Arial;font-size:14px;margin:0px">I don't know if the memory created by Arena.openShared() or any other shared scope would be safely accessed by multiple threads.</div><div style="color:rgb(0,0,0);font-family:Arial;font-size:14px;margin:0px">Simply put, if a writer thread wrote something into the MemorySegment and then passing it to the reader thread using a BlockingQueue,</div><div style="color:rgb(0,0,0);font-family:Arial;font-size:14px;margin:0px">I am confused if the writer operation would already be visible to the reader thread.</div><div style="color:rgb(0,0,0);font-family:Arial;font-size:14px;margin:0px">I have tested its visibility using jcstress and it turns out every Varhandle.get() will successfully read the data changed in another thread, </div><div style="color:rgb(0,0,0);font-family:Arial;font-size:14px;margin:0px">even without volatile or locks, so I am confused if the jvm has already created memory fence for memorysegment's access.</div><div style="color:rgb(0,0,0);font-family:Arial;font-size:14px;margin:0px">I hope the authorities could offer a suggested way of accessing same memory segment in multiple threads in Panama FFI's documentation.</div></div>