fifo

Most elegant way to implement a circular list (FIFO)

What is the most elegant and simple way to implement a circular list, FIFO style? I'm looking for a solution that doesn't resort to hacks like catching exceptions. No, this is not for homework. For a little background, I want to use a circular list within GWT; so using a 3rd party lib is not what I want. Edit: In order to clarify, I r...

Efficient data transfer from Java to C++ on windows

I'm looking to stream lots of data (up to ~1 Gbit) from Java to a C++ application (both on the same machine). I'm currently using a FIFO on Linux but need a Windows solution too. The most cross-platform method seems to be a local socket, but: a) won't I get huge overhead from TCP checksumming and copying to & from kernel space, and b) w...

Linux kernel /proc FIFO/pipe

I'm currently trying to create a kernel module that will produce data based on kernel events and push them to a file. After reading that this is bad (and I agree), I decided it would make more sense to have the data in a /proc file that a user program could pull from when necessary. However, this idea led to all sorts of problems, part...

Blocking read from FIFO via ifstream object

I open a FIFO file as ifstream. As soon as the object is created the thread is blocked until I send something into the FIFO (which is OK for me). I then call getline() to get the data from stream. How do I read-block the thread again until more data is written into FIFO file? Thanks ...

How do I perform a non-blocking fopen on a named pipe (mkfifo)?

If I have a program which creates and attempts to open a named pipe using mkfifo, how can I open a pipe for reading or writing without blocking? Specifically, I'm writing a C program which can be run with or without a gui (written in Java). In the C program, I successfully create the named pipes using mkfifo, however when I do FILE* i...

Are there repercussions to having many processes write to a single reader on a named pipe in posix?

I am writing a program for POSIX (OSX) where I will have many processes sending messages to one listener, who is essentially a logging thread. All of the processes are running in seperate programs, and using a single named pipe (FIFO) that many processes write to, but only a single process reads from is very tempting. Questions: 1) ...

How to debug a weird threaded open fifo issue?

A web service is configured to expose some of its data when receiving a USR1 signal. The signal will be sent by a xinetd server when it receives a request from a remote client, e.g. nc myserver 50666. When the web server receives USR1 signal, it opens a dedicated fifo pipe, writes its data to the pipe, and then close the pipe. In the mea...

FIFO with winform in C#

I'm getting annoyed with GUI problems in my threads. How do i create a FIFO so my main form/thread will receive data to do things instead of having my threads use a callback and run the code (and fail) themselves? The gui problem in question -> http://stackoverflow.com/questions/729359/thread-exception-on-selectednode-nodes0/729377 ...

What is the correct term for a fixed sized FIFO queue?

What is the correct name for the following data structure? It is: A queue of fixed size New elements are added to the start Whenever the queue gets above a certain size a number of elements are removed from the end ...

In linux: writing into a FIFO

I created a new FIFO using the 'mkfifo' command. I have a text file f.txt. I want to write the text file into my FIFO. How? Is there a unix command for that? ...

Can't write to FIFO file mouted via NFS

I'm trying to write to FIFO file locate on NFS mount and it blocks. What could be the problem? My /etc/export: /tmp/test/ 10.0.0.0/24(rw,no_root_squash,async) ls /tmp/test on NFS server and client is the same prw--w--w- 1 root root 0 2009-06-24 17:28 ui-input and I'm writing as root Thanks. ...

Problem with non blocking fifo in bash

Hi! I'm running a few Team Fortress 2 servers and I want to write a little management script. Basically the TF2 servers are a fg process which provides a server console, so I can start the server, type status and get an answer from it: ***@purple:~/tf2$ ./start_server_testing Auto detecting CPU Using AMD Optimised binary. Server will ...

Which STL container should I use for a FIFO?

Which STL container would fit my needs best? I basically have a 10 elements wide container in which I continually push_back new elements while pop_front ing the oldest element (about a million time). I am currently using a std::deque for the task but was wondering if a std::list would be more efficient since I wouldn't need to realloca...

Create a temporary FIFO (named pipe) in Python?

How can you create a temporary FIFO (named pipe) in Python? This should work: import tempfile temp_file_name = mktemp() os.mkfifo(temp_file_name) open(temp_file_name, os.O_WRONLY) # ... some process, somewhere, will read it ... However, I'm hesitant because of the big warning in Python Docs 11.6 and potential removal because it's ...

Call LaTeX on a named pipe (fifo)?

I'm running LaTeX on a named pipe fifo on Unix. I create the fifo like-so: $ mkfifo fifo I then run LaTeX like-so: $ latex fifo This process blocks and has no output until I write to the fifo from another shell: $ echo "\\end" > fifo Then the $ latex fifo output becomes: This is pdfTeXk, Version 3.1415926-1.40.9 (Web2C 7.5.7) %...

not exactly fifo

I'm busting my head but cannot find a solution for this. Please consider this scenario: I have writers that want to write to non-blocking "queue" to another machine on the local network and have a reader that will read data (blocking mode if there are no writers) and do some job A and then return after a long hour and take next data. ...

How can I catch Sybase bcp errors reliably?

We're using named pipes with Sybase bcp so that we can compress output on-the-fly. This is a paraphrase of the error handling idiom, some error checking in the non-bcp parts of the script has been removed to shorten the example. while : do { rm -f $fifo mkfifo $fifo cat $fifo & CatPid=$! b...

FIFO semaphore test

Hello everyone, I have implemented FIFO semaphores but now I need a way to test/prove that they are working properly. A simple test would be to create some threads that try to wait on a semaphore and then print a message with a number and if the numbers are in order it should be FIFO, but this is not good enough to prove it because that ...

Named Pipes (FIFOs) on Unix with multiple readers

I have two programs, Writer and Reader. I have a FIFO from Writer to Reader so when I write something to stdin in Writer, it gets printed out to stdout from Reader. I tried doing this with TWO Readers open, and I got output to stdout from only one of the two Reader programs. Which Reader program Unix chooses to print stdout from seemed...

Informix: Fifo valuation with SQL/Stored procedures

I am using IDS 10 and I have a simple transaction table with the inventory changes with product ID, transaction time, volume, quantity and price. Is it possible to determine the FIFO valuation solely with SQL/Stored procedures or do I need to use something like Perl with DBI for the cursor handling? Fifo valuation requires cursor-handlin...