python sysv-ipc create/attach/delete a shared memory

639 views Asked by At

I need to start a process create shared memory, and then start other processes to read it. is there an example ?

run: SharedMemory(9001,mode=666,size=9999,flags=IPC_CREX)

got: sysv_ipc.PermissionsError: No permission to attach

run again: got: sysv_ipc.ExistentialError: Shared memory with the key 9501 already exists

1

There are 1 answers

0
王俞禮 On

Your mode parameter should pass 0o666 in a octal form not in a decimal form.