What I'm currently doing is creating the whole list before I fork, on main(). The two child processes, one of which adds nodes, while the other removes them, don't really free any memory, I'm simply...
Type: Posts; User: Sirfabius
What I'm currently doing is creating the whole list before I fork, on main(). The two child processes, one of which adds nodes, while the other removes them, don't really free any memory, I'm simply...
I was able to overcome this problem mapping the linked list in shared memory, like so:
if ((shmid = shmget(keysharedmem, sizeof(struct node), IPC_CREAT | 0666)) < 0) {
...
Thanks for the reply. How would you do it if the list had to be altered after the processes forked, and fully accessed by both processes? Keep the whole thing in shared memory?
Hello all!
First time poster here. I have a problem and I'm at my wit's end on how to solve it. Basically I'm trying to put together a doubly linked list whose head is in a shared memory segment....