The purpose of this program is to change such that it makes

Assignment Help Operating System
Reference no: EM13351099

The purpose of this program is to change such that it makes use of the IPC facilities provided by UNIX.

774_Use of the IPC facilities provided by UNIX.png

Master:

• Accepts command line inputs (N filenames and string to find).
• Forks "Reads Files,"(repeatedly, once for each input file) "Concatenate Text," and "Finds word."

Reads Files:
• Accepts command line inputs (1 filename, 1 pipe ID, 1 semaphore key, and 1 shared memory key).
• Reads text from the specified file and determines how big the file is.
• Creates a dynamic 1D array to hold the text.
• Strips repeating blanks from the text.
• Determines the resulting size of the text.
• Writes the new size into shared memory 1.
• Waits for semaphore 1to be set (by Concatenate Text program).
• Writes the text into pipe 1.
• Terminates.

NOTE -To terminate the entire process you can assume that the filename "EXIT" will be sent to this program. You can use this to set shared memory 1 to -1.

Concatenate Text:
• Accepts command line inputs (2 pipe IDs, 2 semaphore keys, and 2 shared memory keys).
• Waits for a non-zero value to be written into shared memory 1.
• Creates a dynamic 1D array large enough to concatenate the new text with any old text.
• Copies the old text into the new array.
• Sets semaphore 1.
• Set shared memory 1 to 0.
• Reads data from pipe 1.
• Concatenates the new data with the old.
• Waits for next data stream (non-zero in shared memory 1).

NOTE -If this program finds a -1 in shared memory 1 it will assume that all of the data to be concatenated has been sent. At this point this program will:
o Write the final text size into shared memory 2.
o Waits for semaphore 2 to be set (by Find Words).
o Writes resulting text into pipe 2.
o Terminates.

Find Words:
• Accepts command line inputs (1 pipe ID, 1 semaphore key, 1 shared memory key, and 1 string to find).
• Waits for a non-zero value to be written into shared memory 2.
• Creates a dynamic 2D array of characters (80xM) large enough to hold the combined text.
• Sets semaphore 2.
• Reads text from pipe 2.
• Searches for the text passed in by:
o Scans the 2D array (crossword like manner -by rows, by column, by diagonal) looking for the string.
o If the string is found, continue scanning the text in the same "direction"to find the secret message. Your program must print out this secret message.
• Terminates.

Reference no: EM13351099

Questions Cloud

Q1 what is the dissimilarity in your blood alcohol level : q1. what is the dissimilarity in your blood alcohol level between a full and empty stomach after you drank 3 malted
Q1 a 240 g block hangs from a spring with spring constant : q1. a 240 g block hangs from a spring with spring constant 8.0cm. at the block is 23cm below the equilibrium point and
1 describe the competitive strategies used by each of : 1 describe the competitive strategies used by each of william-sonomas competitors. which of these strategies are the
Q1 a scuba tank is filled with air to a pressure of 292 atm : q1. a scuba tank is filled with air to a pressure of 292 atm when the air temperature is 23 degrees celcius. a diver
The purpose of this program is to change such that it makes : the purpose of this program is to change such that it makes use of the ipc facilities provided by unix.masterbull
Q1 a vertical spring with a spring constant of 370 nm is : q1. a vertical spring with a spring constant of 370 nm is mounted on the floor. from directly above the spring which is
Q1 a steel paper clip is bent by a force of 102 n exerted : q1. a steel paper clip is bent by a force of 10.2 n exerted on it through a distance of 4.85 cm. by how much does
Q1 collapsible plastic bags are used in hospitals for : q1. collapsible plastic bags are used in hospitals for infusions. we want to use such a bag to infuse an electrolyte
Emma employee works as a salesperson her company : emma employee works as a salesperson. her company international widgets implements a sales incentive program- if any

Reviews

Write a Review

Operating System Questions & Answers

  Explain unix as a key component for forensic examiners

Write a paper, examining computer forensic issues as they are related to Microsoft Windows and Macintosh environments and explain UNIX as a key component for forensic examiners;

  Creating the source code and flowchart

Construct a C program that displays a title, "Hello World." Insert comments in the event to document the program internally. Attach a design flow chart.

  Managing network addressing issues

1st national banks president congratulates you on successfully managing her network's addressing issues. She then shares the data that she's about to make an offer to buy Monroe's other banks, Metropolitan savings.

  Explain the sequence of events

Assume three values (x, y, and z) are stored in a equipments memory. Explain the sequence of events that lead to the computation of x+y+z.

  Difference between a formal and an informal system

Explain the main reasons that firms implement intranets and one major obstacle to obtaining these benefits also explain the difference between a formal and an informal system.

  Compare windows operating system with mac os

Compare windows Operating system with mac OS. write advantages and disadvantages of both (400 words). 2. Briefly discuss the usage of the following Microsoft office software (800 words)

  Threads

Explain a complication that concurrent processing adds to an operating system.

  For each of these four modifications

For each of these four modifications, compute and graph the effects on the original system. Explain in words the effect when the multiprogramming level, N , is small and when N is large.

  Describe how to prevent race condition from occurring

Function and wife calls deposit (). Explain how a race condition is possible and what might be done to prevent race condition from occurring.

  Solving hipaa privacy issues

Suppose if we learned anything from Katrina and Joplin, paper records are susceptible to loss en masse. Can you assume having 50,000 paper records blown for miles across Joplin and trying to recreate those records later

  Ethics with computer hackers

White Hat Cracking engage security testing by arrangement. Grey Hat Cracking seeks to identify insecure systems and inform administrators or users of vulnerabilities.

  Virtual machines

Virtual machines supported by a host operating system

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd