Reputation: 781
I have a problem, where I have to read streaming data from a pipe, to which an application written in C writes data. another application written in java has to read from this linux pipe. This java program is a multi threaded program, to read data from that pipe when other program write data into it. And it should be continuously reading from pipe, as data being added to pipe queue. Any suggestions would be helpful.
Problem trying to solve is:
Currently one application(in C) creates files real-time continuously to a directory , and another application(in java) read and process those files. in this approach there is some time delay because of writing and reading from files from different directories, Hoping using Linux pipe could help to reduce that time delay. Is there any other better approach to handle continuous large volumes of data?
I googled for some sample examples for this to read fifo using multi-thread java program. I could not find any suitable examples, Please share if you come across any of such.
Upvotes: 0
Views: 1236
Reputation: 111
If you create a FIFO file, you will not actually write to disk, it will just be a file in the filesystem to make it easier to access. You can read up on it on the man pages of fifo(7) (man 7 fifo
) for information about FIFOs and mkfifo(1) (man 1 mkfifo
) for a command to make them in C.
Upvotes: 1