News for hackers. Stuff that matters.
Re:Leveraging Rust in our high-performance Java database by klauserc on Wednesday September 20, 2023 @10:23AM (#37584524)
Very interesting to see how the Rust-JNI interface gets used in a production environment (e.g., the topic of unifying logging typically doesn't come up in "your first Rust-JNI app" tutorials, for instance)

I do have one question around the assignment to `static mut CALL_STATE`. Don't you need some form of synchronization/memory fence/memory barrier to make sure that other threads see that assignment?

On x86/x64 it probably doesn't matter (total store order), but other architectures are less lenient.

Re:Leveraging Rust in our high-performance Java database by amunra__ on Wednesday September 20, 2023 @10:26AM (#37584563)
We have an initialisation step as soon as we load the jni lib that takes care of this. Given that this gets done before any other threads are started, I don't think there'd be an issue. Good point :-)