Reputation: 8732
My university professor has asked me to develop a project in C for Unix machines. I should do a soccer championship emulator, in which there is a parent, and there are some child(every match between two teams). The parent must create the matches, and the matches must tell the end result to the parent.
I think the best thing to do is to use fork() syscall and unnamed pipes.
What do you think about?
Thanks
Upvotes: 0
Views: 167
Reputation: 19333
Your suggestion above is valid. That approach would work. It might be easier to use a chunk of shared memory and mutex instead, but it's ultimately your call. I've included a working example that uses pthread_mutex
calls and mmap
in the references below that should get you up and running. Good luck!
References
<https://stackoverflow.com/questions/19172541/procs-fork-and-mutexes>
Upvotes: 1