{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Project4 - CSSE 340 Operating Systems Project 4...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSSE 340 Operating Systems Project 4: Multi-Process and Shared Memory Management Project Descriptions This project is intended to make students familiar with C/C++ programming on a UNIX/Linux system. It requires programming skills on process creation, termination and inter-process communications using shared memory. You are required to implement a small multi-process program that simulates a simple game. To set up the game, initially a base number ( base ) is assigned to 5, and then all players form a ring to play. The first player picks a random number ( rand_num ) between 1 and 10, and compares it against base . If rand_num is equal to or larger than base , then the player calls the next player for the next play and stays in the ring. If rand_num is smaller, then the player calls the next player but leaves the ring. In either case, the player always updates the base with its own rand_num . The game continues until only one player is left, and then the last player becomes the winner and the game ends. Specification and Requirement a) The initial base is set to 5; it should be stored in shared memory. b) The parent process creates child processes based on the input, num_process . The position of each process in the ring is determined in the order of its creation, i.e. the parent process is player #1 (player_id = 1), the first child process is player #2 (player_id = 2), etc. The processes use shared memory section to communicate with each other.
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern