由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - pollsys 是干嘛的?
相关主题
fdopen能open同一个fd 两次吗?Cannot recvfrom() on ipv6, HELP!
linux select(): can file descriptors be dynamtic ?用INADDR_ANY 怎么才能看出destination IP?
python和java里面非memory资源怎么回收?在Sun Solaris gcc下,怎样知道一个函数在哪个lib里?
[合集] 请教一个Linux系统编程的问题Question about a TICPP example
Socket accept failed - WSAEMFILE想知道家在linux下都有什么c++ socket library
VC6.0 补丁??does the system guarantee this? (转载)
About timeout in Socket Programming.问问跟Linux Kernel Programming 有关的问题
One network C question[合集] 我也花了一小时读了一下python
相关话题的讨论汇总
话题: pollsys话题: select话题: timeout话题: 调用话题: pid
进入Programming版参与讨论
1 (共1页)
h**o
发帖数: 548
1
我在查一个网络socket programming 中的错误。
通过dtrace 我发现大部分cpu 被耗在以下system call:pollsys recvfrom sendto 上。
请问pollsys 一般被谁调用,什么情况下被调用,是周期性的调,信号中断调,事件激
发?如果 用 select() 就可以避免 pollsys?
我没找到相关文档,只知道pollsys is normally used
for checking whether there is any data that can be read from or write to a
file descriptor.
T*******i
发帖数: 4992
2
on Solaris?
If so, it should be the same as poll. You'd better check if how much timeout
is set.

上。

【在 h**o 的大作中提到】
: 我在查一个网络socket programming 中的错误。
: 通过dtrace 我发现大部分cpu 被耗在以下system call:pollsys recvfrom sendto 上。
: 请问pollsys 一般被谁调用,什么情况下被调用,是周期性的调,信号中断调,事件激
: 发?如果 用 select() 就可以避免 pollsys?
: 我没找到相关文档,只知道pollsys is normally used
: for checking whether there is any data that can be read from or write to a
: file descriptor.

h**o
发帖数: 548
3
Thanks.
timeout of what? Do you mean the timeout of select()?
In order to trace who called pollsys, I use
truss -t pollsys -T polsys -p PID, and then
pstack PID.
Here is the result. It seems pollsys is called by select().
From Beej's tutorial on socket programming, I learned that CPU exhaustion
due to polling can be avoided by using select() mode. Why select() also call
poll()?
h**o
发帖数: 548
4
Yes, Solaris 10

timeout

【在 T*******i 的大作中提到】
: on Solaris?
: If so, it should be the same as poll. You'd better check if how much timeout
: is set.
:
: 上。

1 (共1页)
进入Programming版参与讨论
相关主题
[合集] 我也花了一小时读了一下pythonSocket accept failed - WSAEMFILE
不会写pipe大虾帮帮忙吧...VC6.0 补丁??
python descriptor 问题About timeout in Socket Programming.
[请教]命令行的重定向One network C question
fdopen能open同一个fd 两次吗?Cannot recvfrom() on ipv6, HELP!
linux select(): can file descriptors be dynamtic ?用INADDR_ANY 怎么才能看出destination IP?
python和java里面非memory资源怎么回收?在Sun Solaris gcc下,怎样知道一个函数在哪个lib里?
[合集] 请教一个Linux系统编程的问题Question about a TICPP example
相关话题的讨论汇总
话题: pollsys话题: select话题: timeout话题: 调用话题: pid