avatar
PE通过,庆祝一下!# Engineering - 工程
c*n
1
is there an easy module to do the above?
for example, I want to read from the stdout and stderr of the same
Runtime.exec()
avatar
G*y
2
今年4月考的,Civil-Water Resource&Environmental。只用了4个星期准备, 就看了
一遍CERM.看起来PE确实简单啊!因为我的背景是我的ID。
avatar
h*0
3
自己写一个,太简单了。
从两个流“同时”读这一行为本身是定义不良的。你的需求我估计是不管
stdout或者stderr有什么内容反正显示出来就对了,就算顺序不对也没关系。
所以你用两个线程分别从stdout和stderr里读。没数据时两个线程都阻塞着,
一旦某个有数据,立即抢占“主流”。
如果你不马上显示的话,需要开足够的buffer。

【在 c******n 的大作中提到】
: is there an easy module to do the above?
: for example, I want to read from the stdout and stderr of the same
: Runtime.exec()

avatar
l*y
4
rely on CERM even for seismic/survey?

【在 G*****y 的大作中提到】
: 今年4月考的,Civil-Water Resource&Environmental。只用了4个星期准备, 就看了
: 一遍CERM.看起来PE确实简单啊!因为我的背景是我的ID。

avatar
u*s
5
一个thread里读stdout and stderr就可以
我们这的这一段code主要就是为了清Runtime.exec()的stdout/stderr buffer

【在 h*****0 的大作中提到】
: 自己写一个,太简单了。
: 从两个流“同时”读这一行为本身是定义不良的。你的需求我估计是不管
: stdout或者stderr有什么内容反正显示出来就对了,就算顺序不对也没关系。
: 所以你用两个线程分别从stdout和stderr里读。没数据时两个线程都阻塞着,
: 一旦某个有数据,立即抢占“主流”。
: 如果你不马上显示的话,需要开足够的buffer。

avatar
c*n
6
thread is of course easy, but kind of an overkill,
I , the above poster, and some online article I saw came up with exactly
the same code using threads

【在 u****s 的大作中提到】
: 一个thread里读stdout and stderr就可以
: 我们这的这一段code主要就是为了清Runtime.exec()的stdout/stderr buffer

avatar
h*0
7
一个thread读,阻塞了怎么办?

【在 u****s 的大作中提到】
: 一个thread里读stdout and stderr就可以
: 我们这的这一段code主要就是为了清Runtime.exec()的stdout/stderr buffer

avatar
u*s
8
不会

【在 h*****0 的大作中提到】
: 一个thread读,阻塞了怎么办?
avatar
s*e
9
nio was designed to handle duplex. you can take a look there to see if there
is sth you need
avatar
c*n
10
thanks a lot, this is exactly what I am looking for

there

【在 s******e 的大作中提到】
: nio was designed to handle duplex. you can take a look there to see if there
: is sth you need

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。