How does epoll's EPOLLEXCLUSIVE mode interact with level-triggering?

前端 未结 2 881
轻奢々
轻奢々 2021-01-31 11:36

Suppose the following series of events occurs:

  • We set up a listening socket
  • Thread A blocks waiting for the listening socket to become readable, using
2条回答
  •  时光说笑
    2021-01-31 12:16

    This is only a partial answer, but Jason Baron (the author of the EPOLLEXCLUSIVE patch) just responded to an email I sent him to confirm that when using EPOLLEXCLUSIVE in level-triggered mode he does think it's possible that two connections will arrive but only one thread will be woken (thread B keeps sleeping). So when using EPOLLEXCLUSIVE you have to use the same kinds of defensive programming as you use for edge-trigged epoll, regardless of whether you set EPOLLET.

提交回复
热议问题