I am currently working with a PREEMPT_RT patched Linux system (including librt and libpthread) and it seems that my real-time threads work fairly reliable from a timing point of view. What mechanism would be suitable to prevent race conditions when it comes to access of shared resources? In my situation I would like to share statistical information between a real-time and a non-real-time thread (e. g. a telnet interface).
E. g. using a mutex (''pthread_mutex_lock'' and ''pthread_mutex_unlock'') would IMHO undermine the deterministic nature of my real-time task in case the mutex is locked by a non-real-time task and the real-time task has to wait for it. Are there any alternatives or better approaches?