Question
OBJECTIVES To develop a C program that uses both fork() and pipe() process system calls to implement a full duplex communication between two processes. PROBLEM
OBJECTIVES
To develop a C program that uses both fork() and pipe() process system calls to implement a full duplex communication between two processes.
PROBLEM
You are to use the Ubuntu operating system to create two C programs. Program consumerProducer.c and program producerConsumer.c. These two programs will implement full duplex communication.
The producerConsumer program will
- create a text file with the name editSource.txt and will write all sentences of the created file on one pipe to be read by the consumerProducer program.
The consumerProducer program will
- read from the pipe and it will
- count the number of characters,
- the number of words, and
- the number of lines in the received sentences.
It will then
- create a file named theCount.txt,
- write the produced output to theCount.txt, and will
- write the contents of the file theCount.txt on a second pipe to be read the producerConsumer process.
The producerConsumer process will display the received file on standard output.
The contents of the editSource.txt file is as follows:
Source code
represents the part of
process that
contains the programming
language itself. You may
use a text editor to
write your source code file.
You may use the fork(), pipe(), dup(), dup2(), read(), write(), creat(), as well as any of the exec() family of system calls.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started