Skip to content

Commit

Permalink
Add epoll based backend
Browse files Browse the repository at this point in the history
Summary:
This is an epoll based EventBase backend (derived from EventBaseBackendBase).
It has the same functionality as the libevent base one with some implementation differences.
The timers are managed by a timer fd - similar to the high res one available in newer versions of libevent.
We expose the epollfd to allow for monitoring by other epoll instances.

Reviewed By: ot

Differential Revision: D42281517

fbshipit-source-id: 7b097aa8d06bffc8b3f622c77e74a814dfb17570
  • Loading branch information
Dan Melnic authored and facebook-github-bot committed Sep 19, 2023
1 parent 57f4d54 commit 64c8e8d
Show file tree
Hide file tree
Showing 5 changed files with 869 additions and 0 deletions.
23 changes: 23 additions & 0 deletions folly/experimental/io/Epoll.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

#if defined(__linux__) && __has_include(<sys/epoll.h>)
#define FOLLY_HAS_EPOLL 1
#else
#define FOLLY_HAS_EPOLL 0
#endif
Loading

0 comments on commit 64c8e8d

Please sign in to comment.