Pipe, interprocess communication


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Pipe, interprocess communication
# 1  
Old 10-20-2004
Data Pipe, interprocess communication

Earlier I posted a question regarding this issue. I managed to go a step further. Anyway, this is another similar question

Write a programme that creates a ring of three processes connected by pipes. The first process should prompt the user for a string and then send it to the second process . The second process should reverse the string and send it to the third process. The third process should convert the string to uppercase and send it back to the first process. When the first process gets the resultant string, it should display it to the terminal. When this is done, all three processes should terminate

I managed to write from A->b->c, but I do not know how to join from C -> A.
mY lecturer asked me to create another pipe in advance before A starts fork(), and I did so, but although I pass in the message I do not get any result. On top of that, the B->C is also affected, it is not showing any result anymore.

Anyone able to help on this?
Greatly appreciate it.
# 2  
Old 10-23-2004
Question giveexample of what you have done so far.....

so far from what I have understood what you are asking is pretty basic but there is no given example of the work that you have done already and the siubject that you are talking about sounds is pretty broad..
this i would say try a loop... say! a for or while loop and nest an if statment to guarantee that the commands you want to execute get executed...
ex.,
while (expression)
do (-------------------------->a
if (expression)
then......................................>b
(command)
else..........................................>c
(command)
fi
done (loop) use break coomand to terminte loop at specific point
if expression a is a always true c will go back to a
moxxx68Smilie
# 3  
Old 10-23-2004
Post what you have, lets see what you have done. Are you writing a C program or are you attempting to do this in shell using co-processes or signals.

Last edited by google; 10-23-2004 at 10:12 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to ignore Pipe in Pipe delimited file?

Hi guys, I need to know how i can ignore Pipe '|' if Pipe is coming as a column in Pipe delimited file for eg: file 1: xx|yy|"xyz|zzz"|zzz|12... using below awk command awk 'BEGIN {FS=OFS="|" } print $3 i would get xyz But i want as : xyz|zzz to consider as whole column... (13 Replies)
Discussion started by: rohit_shinez
13 Replies

2. Shell Programming and Scripting

Replace pipe with Broken Pipe

Hi All , Is there any way to replace the pipe ( | ) with the broken pipe (0xA6) in unix (1 Reply)
Discussion started by: saj
1 Replies

3. Shell Programming and Scripting

Logging/Reading Interprocess Communications

Greetings, I'm posting this in the shell scripting forum because I'm hoping this can be done in BASH or PERL. If not, I'm still open to suggestions of other ways to do it: I've got an iPhone app that's sending some encrypted (SSL) traffic to a server and I'd like to be able to read the... (0 Replies)
Discussion started by: FiZiX
0 Replies

4. UNIX for Dummies Questions & Answers

Interprocess Communication

Hiya Everybody just joined, Not sure if this is the right section:o I require abit of an assistance with IPC! I know there are different types of IPC porcesses like signals, semaphores, mutexes, shared memory, message queues, pipes and sockets. Now say a system has a number of... (4 Replies)
Discussion started by: G.I.Joe
4 Replies

5. AIX

communication problems

hello i'v two aix servers 4.3. last night the goes down becuse electrical f problems. when the servers comes up i've notice that file /unix is gone. i've fix it and the problem fixed. after few hours the same crash becuse elctrical problems. file /unix is there , but now i've a... (0 Replies)
Discussion started by: ariec
0 Replies

6. HP-UX

Communication Failures

HI ALL, I have been trying to install a particular software using remote linux server. some thing like this: rsh <host ID> /usr/sbin/swinstall -x autoreboot=true -s /tmp/<software> <Product name>. The problem is whenever I try to install the product through a shell script the installation... (1 Reply)
Discussion started by: barun agarwal
1 Replies

7. UNIX for Advanced & Expert Users

Interprocess communication status

hello gurus, I was wondering if someone would help me shed more light on this command. What I know so far is ipcs - stands for inter-process communication status and it reports on the following types of system resources. 1) Message queues 2) Shared memory and 3) Semaphores Please explain... (4 Replies)
Discussion started by: jerardfjay
4 Replies

8. UNIX for Advanced & Expert Users

Interprocess communication using pipes and fork

I'm very worried. I have an assignment that is due in 3 weeks, and also tute exercises which I can't seem to understand and work out. Okay, the question: The parent process will convert the command arguments into integer values using atoi() and store them into an integer array which you will... (2 Replies)
Discussion started by: scmay
2 Replies

9. UNIX for Dummies Questions & Answers

serial communication

This isn't really a unix question, or even a programming question, but I hope you guys can help. I want to create a program to control the electricity on a model railway. I have created the program to that it sends characters over the serial cable, but now I need to do the switch that will... (1 Reply)
Discussion started by: KrazyGuyPaul
1 Replies
Login or Register to Ask a Question