由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - How to debug "broken pipe" in linux programming ? (转载)
相关主题
PyCharm里的Python启动的Process在等待按键,如何继续Solaris CC compiler 如何从pipe读取文件,而不是从硬盘?
Shell script 问题100伪币答谢Linux/Unix编程问题 (转载)
question about socket programmingBroken Pipe in connection pooling, envirement: JBOSS+Oracle
A question related to pipe标 题: 发包子 echo 求助
怎样读一个不断更新的文件how can python code wait for signal from a c code program ? (转载)
linux下面的程序间通信怎么样最快?Python有什么好的方法建two-way pipe?
[合集] 请教一个Linux系统编程的问题新手VB.net一问
不会写pipe大虾帮帮忙吧...没有root权限怎么安装gcc(RHEL5.9) (转载)
相关话题的讨论汇总
话题: pipe话题: debug话题: broken话题: linux
进入Programming版参与讨论
1 (共1页)
w*s
发帖数: 7227
1
【 以下文字转载自 Linux 讨论区 】
发信人: wds (净洗前尘,从头再来), 信区: Linux
标 题: How to debug "broken pipe" in linux programming ?
发信站: BBS 未名空间站 (Wed Dec 21 20:34:08 2011, 美东)
hi we have complicated multithread code, as most companies do.
Now under stress test we have broken pipe.
How to debug this pls ?
Q1:
if in the popen, pclose case,
http://www.crasseux.com/books/ctutorial/Programming-with-pipes.
if 1 thread is exiting, it can check all opening pipes associating with it,
can it ?
if pipes still open, then wait till the other side finishes,
then exit this thread gracefully
Can this work ?
Q2:
if someone uses pipe();
http://linuxprograms.wordpress.com/2008/02/15/using-pipes-in-li
seems it never need to close pipe, then what to do ?
X****r
发帖数: 3557
2
Google SIGPIPE

,

【在 w*s 的大作中提到】
: 【 以下文字转载自 Linux 讨论区 】
: 发信人: wds (净洗前尘,从头再来), 信区: Linux
: 标 题: How to debug "broken pipe" in linux programming ?
: 发信站: BBS 未名空间站 (Wed Dec 21 20:34:08 2011, 美东)
: hi we have complicated multithread code, as most companies do.
: Now under stress test we have broken pipe.
: How to debug this pls ?
: Q1:
: if in the popen, pclose case,
: http://www.crasseux.com/books/ctutorial/Programming-with-pipes.

w*s
发帖数: 7227
3
big cow,
if i use the reference count, do u think it can work ?

【在 X****r 的大作中提到】
: Google SIGPIPE
:
: ,

X****r
发帖数: 3557
4
First, popen creates a new process, not just a new thread.
Second, delay exiting of the child process that reads from
the pipe just masks the underlying problem. What do you do
with these extra data you read in after you're supposed to
exit? If you're going to ignore them, then the parent process
that writes to the pipe should just ignore SIGPIPE and handle
the error in fwrite/fprintf/etc. properly.

【在 w*s 的大作中提到】
: big cow,
: if i use the reference count, do u think it can work ?

1 (共1页)
进入Programming版参与讨论
相关主题
没有root权限怎么安装gcc(RHEL5.9) (转载)怎样读一个不断更新的文件
还是awk牛Blinux下面的程序间通信怎么样最快?
十个包子求助:NodeJS多线程?[合集] 请教一个Linux系统编程的问题
question about "popen" in C/C++不会写pipe大虾帮帮忙吧...
PyCharm里的Python启动的Process在等待按键,如何继续Solaris CC compiler 如何从pipe读取文件,而不是从硬盘?
Shell script 问题100伪币答谢Linux/Unix编程问题 (转载)
question about socket programmingBroken Pipe in connection pooling, envirement: JBOSS+Oracle
A question related to pipe标 题: 发包子 echo 求助
相关话题的讨论汇总
话题: pipe话题: debug话题: broken话题: linux