Thank you for your reply! UNfortunately the programm still isn't running. My problem is multiple readers one writer one, so I can't use the last part you coded =/. I tried just printing out a message...
Type: Posts; User: Joanna91
Thank you for your reply! UNfortunately the programm still isn't running. My problem is multiple readers one writer one, so I can't use the last part you coded =/. I tried just printing out a message...
I wrote this, but something is wrong with it =/ The programm waits for ever after all children have been spawned
/* A readers/writers program for multiple readers and multiple writers */...
I'm sorry but I am a bit confused ^^ Let's say that the readers simply print elements, so we don't mind having two readers run at the same time, but we don't want a reader to be happening at the same...
Thank you for all the information! I'll work on it. In your example, can two writers run at the same time? The sleep function aren't working as you said but I don't really get why. RandomGap seems...
Hello! I have to implement the multiple reader-writer problem using forks and semaphores. i've written this test code:
for(i=0;i<2;i++){
if ((pid = fork()) < 0) {
...
That is a great example thank you! Is there a way for a parent process to have two children? Or should I make "grandchilds' for the 3rd process? Thanks for all the help =)
Thank you everyone! Actually memcpy was right, I can't use threads, probably forks. But I don't know how to avoid messing them all up xD Making seperate programms with mmap or shmem sounds like a...
Hello! I am trying to write a program in c, where you have a linked list and 3 processes share it, one inserts stuff the other deletes and the third reads at the same time. I am a bit confused as to...