How to see a FIFO from all the threads?


 
Thread Tools Search this Thread
Top Forums Programming How to see a FIFO from all the threads?
# 1  
Old 10-02-2009
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 FIFO, an ordinary one (using malloc), and I need the same FIFO to be poped a pushed from all the threads... I've been trying different things but nothing work...

Is this possible??? Where can I read something about this???

The other possibility is to make a FIFO for each thread and keep them updated using some invented protocol between threads, but I would prefer not doing this because I'm wasting lots of memory.

Someone have (is correct or I have to use has??) any idea???


Thanks in advance!!!

bye!
# 2  
Old 10-02-2009
Yes it can be done. What you have to do is create a thread safe FIFO (queue). One place to look for implementation ideas is the Apache portable runtime utility apr_queue_* APIs.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Mplayer fifo.

Hi all, First of all, sorry for the pastebin link. The code tags aren't working for me. #!/bin/bash # while-menu-dialog: a menu driven - Pastebin.com This is a channel "changer" shell script i'm working on. It uses dialog to display the menus. It... (3 Replies)
Discussion started by: ignatius
3 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. 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

4. 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

5. Programming

help About fifo and thread

hi, my problem is i have 10 thread for produces double two dimensional array these will produces 2d array 400 times ,then i have a thread to takes a two dimensional array then it inverse , and most 10 array can be in the fifo , and threads given takes one by one, now my problem is , i cant... (0 Replies)
Discussion started by: bblackened
0 Replies

6. 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

7. UNIX for Advanced & Expert Users

Threads and Threads Count ?

Hi all, How can I get the list of all Threads and the Total count of threads under a particular process ? Do suggest !! Awaiting for the replies !! Thanks Varun:b: (2 Replies)
Discussion started by: varungupta
2 Replies

8. 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

9. Programming

FIFO issue

hello i am making a client server program that communicates via FIFOS and i cannot get it to not hang i also am forking exec-ing the client from the server my logic (i will spare you the code ) in the server i make two fifos in my server my file permissions are 0644 i then open both... (1 Reply)
Discussion started by: runawayNinja
1 Replies

10. UNIX for Advanced & Expert Users

FIFO over NFS

Hi All L2000-44 HP-UX 11.00 I am attempting to setup a FIFO over NFS. Directing and reading from the FIFO works fine on the local machine - however when I direct to the FIFO from a server which has the directory NFS mounted it does not work. The a process to read from the FIFO on the local... (2 Replies)
Discussion started by: saabir
2 Replies
Login or Register to Ask a Question