USing two seperate programmes on same FIFO


 
Thread Tools Search this Thread
Top Forums Programming USing two seperate programmes on same FIFO
# 1  
Old 03-20-2009
USing two seperate programmes on same FIFO

hi this is a problem statement i have tried real hard but could not come up with a satisfactory program can someone help

you are to create a pair of programs that do the following in this order:

1 one of the program creates a FIFO which another program should be able to write into
2 the program which created the FIFO should be able to read msg from it, which have been written by the other program
3 set up an alarm that will terminate both processes after 10 sec
4 get the writing process to repeatedly write 10 byte msg into the FIFO, maintaining as it goes, a count of the number of messages it has written. this process shoould do this continously and without delay
5 get the other process to read these messages as fast as they arrive and maintain a count of the number of messages it has read
6 once this has been happening for 10 sec n alarm is to terminate both processes and print out a score of total no of messages written and read and also an approximate transmission rate in bytes per sec

ensure every system call you make has its return value checked in your program
# 2  
Old 03-20-2009
Is this homework?
# 3  
Old 03-20-2009
Well then post what you have tried so far...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Answers to Frequently Asked Questions

Running Turbo-cad and circuit wizard programmes.

Hi. i am new to Linux. i have a Turbo-cad and circuit wizard programme on CD that I want to install and run. I keep getting the message I do not have an auto-run programme. Do I need to install specific drivers for this? What programme do I need? (1 Reply)
Discussion started by: Alfred Kruger
1 Replies

2. UNIX and Linux Applications

FIFO

Hello , I am working on unix FIFO IPC. i have a doubt regarding that. If the fifo is updated(write()) through one process....can we able to send any signal that fifo is updated and ready to get read...to other process.?? (0 Replies)
Discussion started by: Harry443
0 Replies

3. Ubuntu

Cannot see 'tick boxes' and other contents when installed programmes using Wine. Is there any other

Hi! I have installed ubuntu out of an error, a bit of frustration, a bit of annoyance and a bit of excitement! I am (was!) a windows user. I had windows 7 on my laptop. You might already know how famous windows is with nasty viruses. I got one too! Had no option but to get rid of the whole... (3 Replies)
Discussion started by: ubuntu_noob
3 Replies

4. Programming

Help With FIFO problem...

=server.c= #include <stdio.h> #include <stdlib.h> #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #include <errno.h> #include <fcntl.h> #include <string.h> #include <signal.h> #define MSGSIZE 50 (1 Reply)
Discussion started by: sponge
1 Replies

5. Programming

fifo

Dear friends i'm want to implement a program which one file is split into fragments by the server (by some random size) and sent to some processes, so these processes get randomly the fragments of the original file from the server, then the downloader randomly connects to some of these processes... (0 Replies)
Discussion started by: saman_glorious
0 Replies

6. Programming

How to see a FIFO from all the threads?

Hello C programming fellows!!! I'm doing a program with multiple threads in gnu/linux, ubuntu for beeing precise... This program consist in multiple threads, as logical each thread do different things and communicate to each other using IPC. The problem is that in "process 1" I have a... (1 Reply)
Discussion started by: Sandia_man
1 Replies

7. Programming

FIFO's and asynchronousity?

Hello, I have a FIFO which i would like to open O_WDWR | O_NONBLOCK | O_ASYNC and have a SIGIO signal generated when there is input on the FIFO, but there a re a bunch of bugs surrounding this (like for instance i read somewhere that you have to set O_ASYNC with fcntl etc. is this even... (0 Replies)
Discussion started by: davo666
0 Replies

8. Shell Programming and Scripting

Replacing contents in a file from multiple programmes

Hi All, I have a query on Perl. I have a text file which has 3 lines, i want to only replace the first line with my replaced text and keep the rest of the text. FOr eg Before change --> echo:a:pending echo:b:pending echo:c:pending After change ---> echo:a:done echo:b:pending... (1 Reply)
Discussion started by: tosatesh
1 Replies

9. UNIX for Dummies Questions & Answers

Doubts on FIFO

Hi , I m beginner for Unix and i want to use FIFO in my 2 Scripts . I want 1 script to read data from FIFO and other will write into FIFO. Despite reading so many articles/posts i am still unable sunchronize my scripts. My doubts are 1> Do We require both scripts as daemons to use... (0 Replies)
Discussion started by: Akshay
0 Replies

10. Programming

how to use fifo

hi, I have a problem. I've done a lil program which gets from the server the given persons username a personal folder. I made it with a pipe calling popen with a command, but how can i make the same thing using fifo. I make the fifo with mkfifo() func. and than what. How do I tell the sertver using... (3 Replies)
Discussion started by: atticus
3 Replies
Login or Register to Ask a Question