boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - how can python code wait for signal from a c code program ? (转载)
相关主题
面试问题一问 (转载)
请教一个线程同步的问题。
how to write a function take iterators as parameters?
a c++ question
哪位能推荐一本python的书
Python有什么好的方法建two-way pipe?
请教python
请推荐最好的C++/Java/Python开源代码
Python里边file writer的问题
yield和goroutine啥区别?
相关话题的讨论汇总
话题: code话题: wait话题: pipe话题: signal话题: python
进入Programming版参与讨论
1 (共1页)
w*s
发帖数: 7227
1
【 以下文字转载自 Linux 讨论区 】
发信人: wds (网虫都是loser), 信区: Linux
标 题: how can python code wait for signal from a c code program ?
发信站: BBS 未名空间站 (Mon Jul 29 21:30:13 2013, 美东)
hi we have a program from c code, it uses named pipe,
then use select() to wait on it,
basically if someone writes data into this pipe,
we'll catch it with select() (not 100% sure, but sth. like this)
normally another c code process can catch this and reports we get data.
i want to replace it with python, how can i do that ?
i mean how can i wait for this write-to-pipe signal ?
many thanks !h
r****t
发帖数: 10904
2
simply open the pipe and loop over the iterator. it blocks and waits for
other processes to write.

【在 w*s 的大作中提到】
: 【 以下文字转载自 Linux 讨论区 】
: 发信人: wds (网虫都是loser), 信区: Linux
: 标 题: how can python code wait for signal from a c code program ?
: 发信站: BBS 未名空间站 (Mon Jul 29 21:30:13 2013, 美东)
: hi we have a program from c code, it uses named pipe,
: then use select() to wait on it,
: basically if someone writes data into this pipe,
: we'll catch it with select() (not 100% sure, but sth. like this)
: normally another c code process can catch this and reports we get data.
: i want to replace it with python, how can i do that ?

1 (共1页)
进入Programming版参与讨论
相关主题
yield和goroutine啥区别?
python下怎么解决GIL?
PyCharm里的Python启动的Process在等待按键,如何继续
gdb catch signal
对STL的set比较熟悉的进来看看
How to avoid getting "has encountered a problem and needs to close" window
如何GDB调试因pthread_cond_wait()阻塞的线程? (转载)
请大家帮忙看一下:关于AJAX 中加入“Pleas wait... ” message
问个socket close的问题
怎么才能在Unix里连续跑10个c写的程序
相关话题的讨论汇总
话题: code话题: wait话题: pipe话题: signal话题: python