/* Epoll private bits inside the event mask */
#define EP_PRIVATE_BITS (EPOLLWAKEUP | EPOLLONESHOT | EPOLLET | EPOLLEXCLUSIVE)

主要是看下:惊群源:

1、socket wake_up 

2、epoll_wait 中wake_up 

 

目前data ready的时候调用sk_data_ready 唤醒进程,此时唤醒进程选择了  只唤醒一个

 

epoll oneshot  EPOLLONESHOT
/ nr_exclusive是1  
  
static void __wake_up_common(wait_queue_head_t *q, unsigned int mode,  
  
int nr_exclusive, int wake_flags, void *key)  
  
{  
  
wait_queue_t *curr, *next;  
  
list_for_each_entry_safe(curr, next, &q->task_list, task_list) {  
  
unsigned flags = curr->flags;  
  
if (curr->func(curr, mode, wake_flags, key) &&  
  
(flags & WQ_FLAG_EXCLUSIVE) && !--nr_exclusive)  
  
break;  
  
}  
  
}  
View Code

相关文章:

猜你喜欢
  • 2021-06-13
  • 2021-06-20
  • 2021-07-21
  • 2021-03-31
  • 2021-10-19
  • 2021-12-13
相关资源
相似解决方案