Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有多个子进程fork()在同一个 fd 集上监听。
fork()
是全部通知还是只通知其中一个?
是的,两个进程都会触发事件。但是如果你使用 EPOLLET,可能会出现竞争条件。
它们都应该被通知,除非它们中的一个对准备好的文件描述符起作用,并且在另一个忙时使它们不再准备好(不在 epoll 中等待,因此“错过”通知)。