问题描述
给出以下形式的bash命令行
Given a bash command line of the form
commandA | commandB
我想添加一个大小为〜1MB的缓冲区,该缓冲区位于commandA
和commandB
之间.我希望能够以某种形式做到这一点
I want to add a buffer of size ~1MB that sits between commandA
and commandB
.I would expect to be able to do this with something of the form
commandA | BUFFER | commandB
但是用于BUFFER
的命令是什么?
but what is the command to use for BUFFER
?
备注:我想这样做是为了使两个命令解耦,以使它们更好地并行化.问题在于commandB
以大块处理数据,这当前意味着commandA
阻塞,直到commandB
用块完成.所以一切都按顺序运行:-(
Remark: I want to do this in order to decouple the two commands to make them parallelize better. The problem is that commandB
processes data in large chunks, which currently means that commandA
blocks until commandB
is done with a chunk. So everything runs sequentially :-(
推荐答案
BUFFER称为缓冲区. (第1个缓冲区,也许在apt-get安装缓冲区之后)
BUFFER is called buffer. (man 1 buffer, maybe after apt-get install buffer)
这篇关于向两个命令之间的管道添加大缓冲区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!