Questions tagged [fifo]

Any structure in which the First object In is the First object Out. Synonyms include queue, and pipe.

Any structure in which the First object In is the First object Out.

See:

1105 questions
13
votes
5 answers

Inter-process communication without FIFOs

Inside a BASH script we can have multiple processes running in background which intercommunicate using named pipes, FIFOs registered on the filesystem. An example of this could be: #!/bin/bash mkfifo FIFO # BG process 1 while :; do echo x; done &…
davide
  • 2,082
  • 3
  • 21
  • 30
13
votes
1 answer

What conditions result in an opened, nonblocking named pipe (fifo) being "unavailable" for reads?

Situation: new_pipe = os.open(pipe_path, os.O_RDONLY | os.O_NONBLOCK) # pipe_path points to a FIFO data = os.read(new_pipe, 1024) The read occasionally raises errno -11: Resource temporarily unavailable. When is this error raised? It seems very…
UsAaR33
  • 3,536
  • 2
  • 34
  • 55
12
votes
2 answers

Unix FIFO in go?

Is there any way to create a unix FIFO with Go language? There is no Mkfifo, nor Mknod in os package, though I expected named FIFOs are largely used in posix OS's. In fact, there is a function for creating an unnamed FIFO (pipe), but no function for…
zserge
  • 2,212
  • 2
  • 31
  • 40
12
votes
1 answer

Python code hangs while trying to open a named pipe for reading

I am trying to setup two way communication between a daemon and a client using named pipes. The code hangs while trying to open the named pipe used for input Why? class comm(threading.Thread): def __init__(self): self.srvoutf =…
T_Mac
  • 223
  • 3
  • 10
12
votes
1 answer

When I try to open a fifo O_WRONLY I get a "No such device or address" error

In my code I create a fifo named "my_fifo", if I open it in O_WRONLY | O_NONBLOCK mode, open() returns a -1 and an error number of "No such device or address", on the other hand, if I open the fifo in O_RDONLY | O_NONBLOCK mode, it works perfectly.…
presa
  • 195
  • 4
  • 12
11
votes
3 answers

forcing a program to flush its standard output when redirected

i have a closed source program that prints output to standard output. i need to parse the output. so i redirect the output to a fifo (from which i can read in the parent process that forks and execs the binary) using dup2 and then exec the program.…
Rohit Banga
  • 18,458
  • 31
  • 113
  • 191
11
votes
1 answer

OSError: [Errno 11] Resource temporarily unavailable. What causes this?

Background I have two python processes that need to communicate with each other. The comminication is handled by a class named Pipe. I made a seperate class for this because most of the information that needs to be communicated comes in the form of…
Sheena
  • 15,590
  • 14
  • 75
  • 113
11
votes
5 answers

Why implement Queues as Circular Array?

When implementing a FIFO like Queues, my instructor always advise us to represent it as a circular array and not in a regular array. Why? Is it because in the latter, we would end up having garbage data in the array?
Sobiaholic
  • 2,927
  • 9
  • 37
  • 54
10
votes
1 answer

Nonblocking/asynchronous fifo/named pipe in shell/filesystem?

Is there a way to create non blocking/asynchronous named pipe or something similar in shell? So that programs could place lines in it, those lines would stay in ram, and when some program could read some lines from pipe, while leaving what it did…
morphles
  • 2,424
  • 1
  • 24
  • 26
10
votes
1 answer

How to guarantee FIFO execution order in a ThreadPoolExecutor

I create a ThreadPoolExecutor with this line of code : private ExecutorService executor = new ThreadPoolExecutor(5, 10, 120, TimeUnit.SECONDS, new ArrayBlockingQueue(20, true)); Then, I run 25 tasks (T01 to T25) so the situation is : 5…
10
votes
5 answers

Does an optimistic lock-free FIFO queue implementation exist?

Is there any C++ implementation (source codes) of "optmistic approach to lock-free FIFO queues" algorithm?
uray
  • 11,254
  • 13
  • 54
  • 74
10
votes
2 answers

FIFO Implementation in Inventory using SQL

This is basically an inventory project which tracks the "Stock In" and "Stock Out" of items through Purchase and sales respectively. The inventory system follows FIFO Method (the items which are first purchased are always sold first). For…
Harish
  • 2,311
  • 4
  • 23
  • 28
10
votes
2 answers

Knitr: redirect chunk code output to terminal

I want to monitor some pretty lengthy parallelized computations embedded in a knitr file. The computations rely on a package I have written, and the relevant function uses mclapply from the multicore package for parallelization. This function…
Pepin_the_sleepy
  • 297
  • 1
  • 13
10
votes
5 answers

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…
jackhab
  • 17,128
  • 37
  • 99
  • 136
9
votes
2 answers

Implementing FIFO using LIFO

Looking at some algorithm exercices on the net, I found an interesting one : How would you implement a FIFO using a LIFO ? I tried myself but I ended up with only one solution : each time we want the front element of the FIFO, copy the lifo into…
Undo
  • 1,165
  • 2
  • 10
  • 15
1 2
3
73 74