Write a C program to create a mmap() that is shared by multiple threads. Use fst
ID: 3856746 • Letter: W
Question
Write a C program to create a mmap() that is shared by multiple threads. Use fstat() to obtain the size of the mapped file to size the mapping. Find out the number of logical processors (or cores) available programmatically by calling sysconf(), as shown, and display this number.
int numCPU = sysconf(_SC_NPROCESSORS_ONLN);
For this problem, however, you are going to create four (4) threads only. Every thread should see the mapping. Each thread will display separate partial contents (sb.st_size/4 bytes) of the file.
Finally, unmap and close the file.
Please show the command line of how to comiple and run the code and the screenshots
Explanation / Answer
versus:
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.