burnettben
Programmer
I have allocated a piece of shared memory in a parent process and then forked to spawn 1 .. n children processes. I have 2 structs, one is a linked list which consists of a pointer to next and a pointer to the other struct (a player) which consists of a char array (name), and some other details. The player information is gained after the fork, but is required by by other processes.
My question is if i add a linked list node to the shared memory and then fork create a player and then attach my self to the shared memory, create a new node and then assign the player pointer to that node, does the player object have to be in common area of memory (another piece of shared memory for example) or can it be in the processes own memory space (ie just create a pointer and assign that pointer)?
My question is if i add a linked list node to the shared memory and then fork create a player and then attach my self to the shared memory, create a new node and then assign the player pointer to that node, does the player object have to be in common area of memory (another piece of shared memory for example) or can it be in the processes own memory space (ie just create a pointer and assign that pointer)?