SOLVED:Programming Assignment 5 solution

29.99 $ 15.00 $

This assignment requires you to write a multi-processed program that works with a memory-mapped file. With the help of virtual memory, memory mapping approach allows a disk file to be initially mapped into memory through demand paging and then to be manipulated subsequently via memory accesses rather than disk file I/O. This can lead to improved performance (refer to pp. 430-433 of the textbook for details). Your C program will spawn two child processes that manipulate a memory-mapped file. Make sure that your submitted program compiles and runs on Athena. 1. In your program, the parent process takes a file name from the command line, creates a file with read/write permissions using the given file name, and initializes the file with the following lower-case string: with the mmap call, a disk file gets mapped into memory through demand\n paging, i.e., a page sized portion of the file is initially read into\n memory through a page fault. subsequent reads and writes to that portion\n of the file are handled as routine memory accesses. this improves file\n processing performance. in this assignment, the parent process memory maps\n this disk file first, and then creates two child processes that each make\n some changes to this file

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: . zip solution files instantly, after Payment

Description

Rate this product

This assignment requires you to write a multi-processed program that works with a memory-mapped file. With the help of virtual memory, memory mapping approach allows a disk file to be initially mapped into memory through demand paging and then to be manipulated subsequently via memory accesses rather than disk file I/O. This can lead to improved performance (refer to pp. 430-433 of the textbook for details). Your C program will spawn two child processes that manipulate a memory-mapped file. Make sure that your submitted program compiles and runs on Athena. 1. In your program, the parent process takes a file name from the command line, creates a file with read/write permissions using the given file name, and initializes the file with the following lower-case string: with the mmap call, a disk file gets mapped into memory through demand\n paging, i.e., a page sized portion of the file is initially read into\n memory through a page fault. subsequent reads and writes to that portion\n of the file are handled as routine memory accesses. this improves file\n processing performance. in this assignment, the parent process memory maps\n this disk file first, and then creates two child processes that each make\n some changes to this file. when both child processes are done, changes\n made in memory are synch’ed to the disk file.\n The parent process then memory maps the file into the memory using the mmap() system call in the following manner (for more information on mmap() call, please refer to the on-line manual via “man mmap”). Afterwards, the parent creates two child processes, waits for the child processes to finish before it exits. #include