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
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>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.