c - How two non related process know the same key to allocate same shared memory -
i learning shared memory ipc. have doubt.
q1. shared memory used related , non related process. , process allocate shared memory shemget
function. first parameter of function key. how 2 non related process know same key allocate same shared memory.
q2. whane using shmget , shmat
function, new or existing(in using ipc_creat | ipc_excl) memory created , mapped process memory space. section of process memory (like heap,bss) shared memory mapped. , in shmat function if pass shmaddr in utilize then, how scheme behave.
q3. utilize case giving fixed memory addredd
in shmat.
refering 1:
how 2 non related process know same key allocate same shared memory.
they either told 3rd entidy or communicate (to) each other.
refering 2b:
and in shmat function if pass shmaddr in utilize then, how scheme behave.
shmat()
fail , homecoming (void*) -1
.
c linux linux-kernel ipc shared-memory
No comments:
Post a Comment