Native application-wide MutableStateFlow

Could anybody explain me how to without using a C extension create something like MutableStateFlow that allow all threads and coroutines query, collect and update an application-wide state? Mutablesharedstate fails out of the box. I’ve heard that I should use redis, temp file or C++ extension do do such a simple thing because kotlin native is in fact a single-threaded by design and intention, like ruby or javascript?