sách gpt4 ai đã đi

select(NULL, NULL, NULL, &timeout) chỉ chờ trong một khoảng thời gian nhất định phải không?

In lại 作者:塔克拉玛干 更新时间:2023-11-03 01:57:56 39 4
mua khóa gpt4 Nike

我在给定的代码中看到了以下行:

select(0, (fd_set *) NULL, (fd_set *) NULL, (fd_set *) NULL, &timeout);

http://linux.die.net/man/2/select

Each of the three file descriptor sets may be specified as NULL if no file descriptors are to be watched for the corresponding class of events.

所以我可以看到将NULL传递给它是有效的。那样的话只能导致做主动等待。

这是正确的吗?我有点不确定..

1 Câu trả lời

Some code calls select() with all three sets empty, nfds zero, and a non-NULL timeout as a fairly portable way to sleep with subsecond precision.

Lấy từđây .

关于c++ - select(NULL, NULL, NULL, &timeout) 只是等待给定的时间吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27297184/

39 4 0
Bài viết được đề xuất: 每个数据 block 的 linux awk 和 grep 特定行
Bài viết được đề xuất: c++ - wxTreeCtrl 上的 wxWidgets AddRoot() 无法添加超过一个节点
Bài viết được đề xuất: C++ 从 .CPP 文件访问变量
Bài viết được đề xuất: linux - 在 bash 脚本中发出回显变量
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com