envoyproxy/envoy

[Events] Add an file event wakeup method with socketpair

Open

#14,244 创建于 2020年12月2日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)C++ (5,373 fork)batch import
help wantedtech debt

仓库指标

Star
 (27,997 star)
PR 合并指标
 (平均合并 8天) (30 天内合并 378 个 PR)

描述

Description:

The goal is to create a premitive in source/common/event that wakes up (schedules) an event using a socketpair instead of scheduleCallbackCurrentIteration. The reason for that is that scheduleCallbackCurrentIteration is using event_active(&raw_event_, EV_TIMEOUT, 0); which takes a lock.

See comment in: https://github.com/envoyproxy/envoy/pull/13954#discussion_r533796896

This mechanism could be applied to:

  1. Win32 DirectoryWatcher
  2. Replace the wakeup mechanism in dispatcher_impl.cc -> void DispatcherImpl::post(std::function<void()> callback)

For Win32 it is good to also have #10871 if we are going to build on top of socketpairs

贡献者指南