4 ms·
Tee writes in one-thread-per-file level of parallelism; simple experiment: $ tee foo.bin bar.bin baz.bin < /dev/zero writes to all three files `at once' (in
by dexen 15y ago
Tee writes in one-thread-per-file level of parallelism; simple experiment:
$ tee foo.bin bar.bin baz.bin < /dev/zero
writes to all three files `at once' (in small time-slices, actually). Used GNU tee from coreutils-8.10.
Perhaps OP meant several-threads-per-file level of parallelism, where number_threads > number_files?
- deleted 15y ago[deleted]
- mvgoogler 15y agotee has a simple main loop: while not EOF: (synchrounously) read up to BUFSIZE bytes from stdin into buf for each output file: (synchrounously) write buf to file (source code here: http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/tee.c http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/tee....) All of the reads and writes are done through synchronous file apis. I don't see where you are getting one-thread-per-file (or any other kind of parallelism) there.
- mvgoogler 15y agotee has a simple main loop: while not EOF: (synchrounously) read up to BUFSIZE bytes from stdin into buf for each output file: (synchrounously) write buf to file (source code here: http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/tee.... http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/tee....) All of the reads and writes are done through synchronous file apis. I don't see where you are getting one-thread-per-file (or any other kind of parallelism) there.