Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - shm_open and O_EXCL: (2 Items)
   
shm_open and O_EXCL  
The doc of shm_open says: "O_EXCL — ...The check for the existence of the shared memory object, and the creation of the
 object if it doesn't exist, are atomic with respect to other ***processes*** executing shm_open()..."

Is that also true of threads, i'm writing test code for some librairies and it seems to not be true for threads. More 
than one threads will once in a while manage to create the same sharedmem ???
Re: shm_open and O_EXCL  
> 
> The doc of shm_open says: "O_EXCL — ...The check for the existence of the 
> shared memory object, and the creation of the object if it doesn't exist, are 
> atomic with respect to other ***processes*** executing shm_open()..."
> 
> Is that also true of threads, i'm writing test code for some librairies and it

Yes

>  seems to not be true for threads. More than one threads will once in a while 
> manage to create the same sharedmem ???

You may be running into a known issue that has been fixed (ref: COREOS-10063 Race condition causes O_EXCL flag to be 
ignored)