[Interest] QSharedMemory attach/create race condition

René J.V. Bertin rjvbertin at gmail.com
Mon Aug 17 17:07:44 CEST 2015


Hi,

The 4.8.7 QSharedMemory documentation mentions that a race condition can occur on QNX if you don't `create()` the segment before trying to `attach()` to it.
FWIW, I had some code on OS X using QSharedMemory instances, where the initialisation routine attempted an `attach()` first and did a `create()` if that attempt failed. This also led to a race condition, ultimately.

I see that race conditions are no longer mentioned in the Qt 5.4 documentation; does one still need to do a `create()` and an `attach()` only if `create()` fails because the resource already exists?

R.



More information about the Interest mailing list