08-21-2012, 12:07 AM
Pipe, in a Unix environment, is a an object that supoprts one-way character-based FIFO communication. You create a pipe using pipe() function, it returns two file descriptors, one for writing and one for reading. What you write to the write-end, you can read on the read end. You can even pass those file descriptors to other processes; that's how inter-process output redirection works (schematically). So next time you use "ls -al | grep MCS", know that the pipe character ("|") means that you're creating a pipe between the two processes.
For our purposes, both ends of the pipe would stay inside the app, just the write end would be used by the logger and the read end by the java thread that would poll it for data (the reading function blocks when there's no data to read, so it's effective).
http://www.cse.ohio-state.edu/~mamrak/CI...notes.html
For our purposes, both ends of the pipe would stay inside the app, just the write end would be used by the logger and the read end by the java thread that would poll it for data (the reading function blocks when there's no data to read, so it's effective).
http://www.cse.ohio-state.edu/~mamrak/CI...notes.html