In this project, you are supposed to implement several programs which will search wordsprovided by the user
Fantastic news! We've Found the answer you've been seeking!
Question:
, : . The output must be sorted
according to first and then . An example execution of your
program should be:
psearch name 3 input1.txt input2.txt input3.txt output.txt
Task 1:
a) Implement the program using multiple processes created by the parent main program. Call the program as psearch1a. Create children via the fork() system call. For n input files, n children must be created. Each child will process one input file and will write the result to a temporary output file. When all children end, the parent process will read the temporary output files and will write one final output file in the above format.
In psearch1a, files will be used to pass information from children to the parent process.
b) Repeat a, but this time name your program as psearch1b and use Shared memory with shared anonymous mapping mmap(). Also you need to use unnamed semaphores for synchronization.
c) Repeat a, but this time name your program as psearch1c and use an anonymous (unnamed) pipeline pipe().
Related Book For
Accounting Information Systems
ISBN: 9780132871938
11th Edition
Authors: George H. Bodnar, William S. Hopwood
Posted Date: