aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--BUILD18
-rw-r--r--Makefile6
-rw-r--r--binding.gyp3
-rw-r--r--build.yaml6
-rw-r--r--gRPC.podspec9
-rwxr-xr-xgrpc.gemspec6
-rw-r--r--package.json6
-rw-r--r--src/core/httpcli/httpcli.c1
-rw-r--r--src/core/iomgr/ev_poll_and_epoll_posix.c (renamed from src/core/iomgr/fd_posix.c)119
-rw-r--r--src/core/iomgr/ev_poll_and_epoll_posix.h37
-rw-r--r--src/core/iomgr/ev_posix.c32
-rw-r--r--src/core/iomgr/ev_posix.h97
-rw-r--r--src/core/iomgr/fd_posix.h192
-rw-r--r--src/core/iomgr/iomgr_posix.c2
-rw-r--r--src/core/iomgr/pollset_multipoller_with_epoll.c2
-rw-r--r--src/core/iomgr/pollset_multipoller_with_poll_posix.c2
-rw-r--r--src/core/iomgr/pollset_posix.c2
-rw-r--r--src/core/iomgr/pollset_set_posix.h2
-rw-r--r--src/core/iomgr/tcp_posix.h2
-rw-r--r--src/core/iomgr/udp_server.c2
-rw-r--r--src/core/iomgr/workqueue_posix.c2
-rw-r--r--src/python/grpcio/grpc_core_dependencies.py3
-rw-r--r--test/core/iomgr/fd_posix_test.c2
-rw-r--r--tools/doxygen/Doxyfile.core.internal6
-rw-r--r--tools/run_tests/sources_and_headers.json18
-rw-r--r--vsprojects/vcxproj/grpc/grpc.vcxproj9
-rw-r--r--vsprojects/vcxproj/grpc/grpc.vcxproj.filters18
-rw-r--r--vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj9
-rw-r--r--vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters18
29 files changed, 384 insertions, 247 deletions
diff --git a/BUILD b/BUILD
index 24e3e54066..7fcf734740 100644
--- a/BUILD
+++ b/BUILD
@@ -204,9 +204,10 @@ cc_library(
"src/core/iomgr/closure.h",
"src/core/iomgr/endpoint.h",
"src/core/iomgr/endpoint_pair.h",
+ "src/core/iomgr/ev_poll_and_epoll_posix.h",
+ "src/core/iomgr/ev_posix.h",
"src/core/iomgr/exec_ctx.h",
"src/core/iomgr/executor.h",
- "src/core/iomgr/fd_posix.h",
"src/core/iomgr/iocp_windows.h",
"src/core/iomgr/iomgr.h",
"src/core/iomgr/iomgr_internal.h",
@@ -341,9 +342,10 @@ cc_library(
"src/core/iomgr/endpoint.c",
"src/core/iomgr/endpoint_pair_posix.c",
"src/core/iomgr/endpoint_pair_windows.c",
+ "src/core/iomgr/ev_poll_and_epoll_posix.c",
+ "src/core/iomgr/ev_posix.c",
"src/core/iomgr/exec_ctx.c",
"src/core/iomgr/executor.c",
- "src/core/iomgr/fd_posix.c",
"src/core/iomgr/iocp_windows.c",
"src/core/iomgr/iomgr.c",
"src/core/iomgr/iomgr_posix.c",
@@ -505,9 +507,10 @@ cc_library(
"src/core/iomgr/closure.h",
"src/core/iomgr/endpoint.h",
"src/core/iomgr/endpoint_pair.h",
+ "src/core/iomgr/ev_poll_and_epoll_posix.h",
+ "src/core/iomgr/ev_posix.h",
"src/core/iomgr/exec_ctx.h",
"src/core/iomgr/executor.h",
- "src/core/iomgr/fd_posix.h",
"src/core/iomgr/iocp_windows.h",
"src/core/iomgr/iomgr.h",
"src/core/iomgr/iomgr_internal.h",
@@ -622,9 +625,10 @@ cc_library(
"src/core/iomgr/endpoint.c",
"src/core/iomgr/endpoint_pair_posix.c",
"src/core/iomgr/endpoint_pair_windows.c",
+ "src/core/iomgr/ev_poll_and_epoll_posix.c",
+ "src/core/iomgr/ev_posix.c",
"src/core/iomgr/exec_ctx.c",
"src/core/iomgr/executor.c",
- "src/core/iomgr/fd_posix.c",
"src/core/iomgr/iocp_windows.c",
"src/core/iomgr/iomgr.c",
"src/core/iomgr/iomgr_posix.c",
@@ -1302,9 +1306,10 @@ objc_library(
"src/core/iomgr/endpoint.c",
"src/core/iomgr/endpoint_pair_posix.c",
"src/core/iomgr/endpoint_pair_windows.c",
+ "src/core/iomgr/ev_poll_and_epoll_posix.c",
+ "src/core/iomgr/ev_posix.c",
"src/core/iomgr/exec_ctx.c",
"src/core/iomgr/executor.c",
- "src/core/iomgr/fd_posix.c",
"src/core/iomgr/iocp_windows.c",
"src/core/iomgr/iomgr.c",
"src/core/iomgr/iomgr_posix.c",
@@ -1461,9 +1466,10 @@ objc_library(
"src/core/iomgr/closure.h",
"src/core/iomgr/endpoint.h",
"src/core/iomgr/endpoint_pair.h",
+ "src/core/iomgr/ev_poll_and_epoll_posix.h",
+ "src/core/iomgr/ev_posix.h",
"src/core/iomgr/exec_ctx.h",
"src/core/iomgr/executor.h",
- "src/core/iomgr/fd_posix.h",
"src/core/iomgr/iocp_windows.h",
"src/core/iomgr/iomgr.h",
"src/core/iomgr/iomgr_internal.h",
diff --git a/Makefile b/Makefile
index 3c215b35b6..7d05a8ab78 100644
--- a/Makefile
+++ b/Makefile
@@ -2371,9 +2371,10 @@ LIBGRPC_SRC = \
src/core/iomgr/endpoint.c \
src/core/iomgr/endpoint_pair_posix.c \
src/core/iomgr/endpoint_pair_windows.c \
+ src/core/iomgr/ev_poll_and_epoll_posix.c \
+ src/core/iomgr/ev_posix.c \
src/core/iomgr/exec_ctx.c \
src/core/iomgr/executor.c \
- src/core/iomgr/fd_posix.c \
src/core/iomgr/iocp_windows.c \
src/core/iomgr/iomgr.c \
src/core/iomgr/iomgr_posix.c \
@@ -2655,9 +2656,10 @@ LIBGRPC_UNSECURE_SRC = \
src/core/iomgr/endpoint.c \
src/core/iomgr/endpoint_pair_posix.c \
src/core/iomgr/endpoint_pair_windows.c \
+ src/core/iomgr/ev_poll_and_epoll_posix.c \
+ src/core/iomgr/ev_posix.c \
src/core/iomgr/exec_ctx.c \
src/core/iomgr/executor.c \
- src/core/iomgr/fd_posix.c \
src/core/iomgr/iocp_windows.c \
src/core/iomgr/iomgr.c \
src/core/iomgr/iomgr_posix.c \
diff --git a/binding.gyp b/binding.gyp
index 82e36c421d..aaba3cde75 100644
--- a/binding.gyp
+++ b/binding.gyp
@@ -616,9 +616,10 @@
'src/core/iomgr/endpoint.c',
'src/core/iomgr/endpoint_pair_posix.c',
'src/core/iomgr/endpoint_pair_windows.c',
+ 'src/core/iomgr/ev_poll_and_epoll_posix.c',
+ 'src/core/iomgr/ev_posix.c',
'src/core/iomgr/exec_ctx.c',
'src/core/iomgr/executor.c',
- 'src/core/iomgr/fd_posix.c',
'src/core/iomgr/iocp_windows.c',
'src/core/iomgr/iomgr.c',
'src/core/iomgr/iomgr_posix.c',
diff --git a/build.yaml b/build.yaml
index f8fc488383..0d906244f2 100644
--- a/build.yaml
+++ b/build.yaml
@@ -280,9 +280,10 @@ filegroups:
- src/core/iomgr/closure.h
- src/core/iomgr/endpoint.h
- src/core/iomgr/endpoint_pair.h
+ - src/core/iomgr/ev_poll_and_epoll_posix.h
+ - src/core/iomgr/ev_posix.h
- src/core/iomgr/exec_ctx.h
- src/core/iomgr/executor.h
- - src/core/iomgr/fd_posix.h
- src/core/iomgr/iocp_windows.h
- src/core/iomgr/iomgr.h
- src/core/iomgr/iomgr_internal.h
@@ -395,9 +396,10 @@ filegroups:
- src/core/iomgr/endpoint.c
- src/core/iomgr/endpoint_pair_posix.c
- src/core/iomgr/endpoint_pair_windows.c
+ - src/core/iomgr/ev_poll_and_epoll_posix.c
+ - src/core/iomgr/ev_posix.c
- src/core/iomgr/exec_ctx.c
- src/core/iomgr/executor.c
- - src/core/iomgr/fd_posix.c
- src/core/iomgr/iocp_windows.c
- src/core/iomgr/iomgr.c
- src/core/iomgr/iomgr_posix.c
diff --git a/gRPC.podspec b/gRPC.podspec
index 13c303a8c7..9d7bc7e8a2 100644
--- a/gRPC.podspec
+++ b/gRPC.podspec
@@ -208,9 +208,10 @@ Pod::Spec.new do |s|
'src/core/iomgr/closure.h',
'src/core/iomgr/endpoint.h',
'src/core/iomgr/endpoint_pair.h',
+ 'src/core/iomgr/ev_poll_and_epoll_posix.h',
+ 'src/core/iomgr/ev_posix.h',
'src/core/iomgr/exec_ctx.h',
'src/core/iomgr/executor.h',
- 'src/core/iomgr/fd_posix.h',
'src/core/iomgr/iocp_windows.h',
'src/core/iomgr/iomgr.h',
'src/core/iomgr/iomgr_internal.h',
@@ -358,9 +359,10 @@ Pod::Spec.new do |s|
'src/core/iomgr/endpoint.c',
'src/core/iomgr/endpoint_pair_posix.c',
'src/core/iomgr/endpoint_pair_windows.c',
+ 'src/core/iomgr/ev_poll_and_epoll_posix.c',
+ 'src/core/iomgr/ev_posix.c',
'src/core/iomgr/exec_ctx.c',
'src/core/iomgr/executor.c',
- 'src/core/iomgr/fd_posix.c',
'src/core/iomgr/iocp_windows.c',
'src/core/iomgr/iomgr.c',
'src/core/iomgr/iomgr_posix.c',
@@ -513,9 +515,10 @@ Pod::Spec.new do |s|
'src/core/iomgr/closure.h',
'src/core/iomgr/endpoint.h',
'src/core/iomgr/endpoint_pair.h',
+ 'src/core/iomgr/ev_poll_and_epoll_posix.h',
+ 'src/core/iomgr/ev_posix.h',
'src/core/iomgr/exec_ctx.h',
'src/core/iomgr/executor.h',
- 'src/core/iomgr/fd_posix.h',
'src/core/iomgr/iocp_windows.h',
'src/core/iomgr/iomgr.h',
'src/core/iomgr/iomgr_internal.h',
diff --git a/grpc.gemspec b/grpc.gemspec
index 4485b440d6..edf24f8a33 100755
--- a/grpc.gemspec
+++ b/grpc.gemspec
@@ -204,9 +204,10 @@ Gem::Specification.new do |s|
s.files += %w( src/core/iomgr/closure.h )
s.files += %w( src/core/iomgr/endpoint.h )
s.files += %w( src/core/iomgr/endpoint_pair.h )
+ s.files += %w( src/core/iomgr/ev_poll_and_epoll_posix.h )
+ s.files += %w( src/core/iomgr/ev_posix.h )
s.files += %w( src/core/iomgr/exec_ctx.h )
s.files += %w( src/core/iomgr/executor.h )
- s.files += %w( src/core/iomgr/fd_posix.h )
s.files += %w( src/core/iomgr/iocp_windows.h )
s.files += %w( src/core/iomgr/iomgr.h )
s.files += %w( src/core/iomgr/iomgr_internal.h )
@@ -341,9 +342,10 @@ Gem::Specification.new do |s|
s.files += %w( src/core/iomgr/endpoint.c )
s.files += %w( src/core/iomgr/endpoint_pair_posix.c )
s.files += %w( src/core/iomgr/endpoint_pair_windows.c )
+ s.files += %w( src/core/iomgr/ev_poll_and_epoll_posix.c )
+ s.files += %w( src/core/iomgr/ev_posix.c )
s.files += %w( src/core/iomgr/exec_ctx.c )
s.files += %w( src/core/iomgr/executor.c )
- s.files += %w( src/core/iomgr/fd_posix.c )
s.files += %w( src/core/iomgr/iocp_windows.c )
s.files += %w( src/core/iomgr/iomgr.c )
s.files += %w( src/core/iomgr/iomgr_posix.c )
diff --git a/package.json b/package.json
index 3042c91680..6cc3ad2a28 100644
--- a/package.json
+++ b/package.json
@@ -149,9 +149,10 @@
"src/core/iomgr/closure.h",
"src/core/iomgr/endpoint.h",
"src/core/iomgr/endpoint_pair.h",
+ "src/core/iomgr/ev_poll_and_epoll_posix.h",
+ "src/core/iomgr/ev_posix.h",
"src/core/iomgr/exec_ctx.h",
"src/core/iomgr/executor.h",
- "src/core/iomgr/fd_posix.h",
"src/core/iomgr/iocp_windows.h",
"src/core/iomgr/iomgr.h",
"src/core/iomgr/iomgr_internal.h",
@@ -286,9 +287,10 @@
"src/core/iomgr/endpoint.c",
"src/core/iomgr/endpoint_pair_posix.c",
"src/core/iomgr/endpoint_pair_windows.c",
+ "src/core/iomgr/ev_poll_and_epoll_posix.c",
+ "src/core/iomgr/ev_posix.c",
"src/core/iomgr/exec_ctx.c",
"src/core/iomgr/executor.c",
- "src/core/iomgr/fd_posix.c",
"src/core/iomgr/iocp_windows.c",
"src/core/iomgr/iomgr.c",
"src/core/iomgr/iomgr_posix.c",
diff --git a/src/core/httpcli/httpcli.c b/src/core/httpcli/httpcli.c
index 71237bb614..9751cb03f2 100644
--- a/src/core/httpcli/httpcli.c
+++ b/src/core/httpcli/httpcli.c
@@ -37,6 +37,7 @@
#include <string.h>
#include "src/core/iomgr/endpoint.h"
+#include "src/core/iomgr/iomgr_internal.h"
#include "src/core/iomgr/resolve_address.h"
#include "src/core/iomgr/tcp_client.h"
#include "src/core/httpcli/format_request.h"
diff --git a/src/core/iomgr/fd_posix.c b/src/core/iomgr/ev_poll_and_epoll_posix.c
index 85eadd754b..ae61ebf278 100644
--- a/src/core/iomgr/fd_posix.c
+++ b/src/core/iomgr/ev_poll_and_epoll_posix.c
@@ -31,11 +31,22 @@
*
*/
+ /* This file will be removed shortly: it's here to keep refactoring
+ * steps simple and auditable.
+ * It's the combination of the old files:
+ * - fd_posix.{h,c}
+ * - pollset_posix.{h,c}
+ * - pullset_multipoller_with_{poll,epoll}.{h,c}
+ * The new version will be split into:
+ * - ev_poll_posix.{h,c}
+ * - ev_epoll_posix.{h,c}
+ */
+
#include <grpc/support/port_platform.h>
#ifdef GPR_POSIX_SOCKET
-#include "src/core/iomgr/fd_posix.h"
+#include "src/core/iomgr/ev_poll_and_epoll_posix.h"
#include <assert.h>
#include <sys/socket.h>
@@ -46,6 +57,112 @@
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
+typedef struct grpc_fd_watcher {
+ struct grpc_fd_watcher *next;
+ struct grpc_fd_watcher *prev;
+ grpc_pollset *pollset;
+ grpc_pollset_worker *worker;
+ grpc_fd *fd;
+} grpc_fd_watcher;
+
+struct grpc_fd {
+ int fd;
+ /* refst format:
+ bit0: 1=active/0=orphaned
+ bit1-n: refcount
+ meaning that mostly we ref by two to avoid altering the orphaned bit,
+ and just unref by 1 when we're ready to flag the object as orphaned */
+ gpr_atm refst;
+
+ gpr_mu mu;
+ int shutdown;
+ int closed;
+ int released;
+
+ /* The watcher list.
+
+ The following watcher related fields are protected by watcher_mu.
+
+ An fd_watcher is an ephemeral object created when an fd wants to
+ begin polling, and destroyed after the poll.
+
+ It denotes the fd's interest in whether to read poll or write poll
+ or both or neither on this fd.
+
+ If a watcher is asked to poll for reads or writes, the read_watcher
+ or write_watcher fields are set respectively. A watcher may be asked
+ to poll for both, in which case both fields will be set.
+
+ read_watcher and write_watcher may be NULL if no watcher has been
+ asked to poll for reads or writes.
+
+ If an fd_watcher is not asked to poll for reads or writes, it's added
+ to a linked list of inactive watchers, rooted at inactive_watcher_root.
+ If at a later time there becomes need of a poller to poll, one of
+ the inactive pollers may be kicked out of their poll loops to take
+ that responsibility. */
+ grpc_fd_watcher inactive_watcher_root;
+ grpc_fd_watcher *read_watcher;
+ grpc_fd_watcher *write_watcher;
+
+ grpc_closure *read_closure;
+ grpc_closure *write_closure;
+
+ struct grpc_fd *freelist_next;
+
+ grpc_closure *on_done_closure;
+
+ grpc_iomgr_object iomgr_object;
+};
+
+/* Begin polling on an fd.
+ Registers that the given pollset is interested in this fd - so that if read
+ or writability interest changes, the pollset can be kicked to pick up that
+ new interest.
+ Return value is:
+ (fd_needs_read? read_mask : 0) | (fd_needs_write? write_mask : 0)
+ i.e. a combination of read_mask and write_mask determined by the fd's current
+ interest in said events.
+ Polling strategies that do not need to alter their behavior depending on the
+ fd's current interest (such as epoll) do not need to call this function.
+ MUST NOT be called with a pollset lock taken */
+uint32_t grpc_fd_begin_poll(grpc_fd *fd, grpc_pollset *pollset,
+ grpc_pollset_worker *worker, uint32_t read_mask,
+ uint32_t write_mask, grpc_fd_watcher *rec);
+/* Complete polling previously started with grpc_fd_begin_poll
+ MUST NOT be called with a pollset lock taken
+ if got_read or got_write are 1, also does the become_{readable,writable} as
+ appropriate. */
+void grpc_fd_end_poll(grpc_exec_ctx *exec_ctx, grpc_fd_watcher *rec,
+ int got_read, int got_write);
+
+/* Return 1 if this fd is orphaned, 0 otherwise */
+int grpc_fd_is_orphaned(grpc_fd *fd);
+
+/* Notification from the poller to an fd that it has become readable or
+ writable.
+ If allow_synchronous_callback is 1, allow running the fd callback inline
+ in this callstack, otherwise register an asynchronous callback and return */
+void grpc_fd_become_readable(grpc_exec_ctx *exec_ctx, grpc_fd *fd);
+void grpc_fd_become_writable(grpc_exec_ctx *exec_ctx, grpc_fd *fd);
+
+/* Reference counting for fds */
+/*#define GRPC_FD_REF_COUNT_DEBUG*/
+#ifdef GRPC_FD_REF_COUNT_DEBUG
+void grpc_fd_ref(grpc_fd *fd, const char *reason, const char *file, int line);
+void grpc_fd_unref(grpc_fd *fd, const char *reason, const char *file, int line);
+#define GRPC_FD_REF(fd, reason) grpc_fd_ref(fd, reason, __FILE__, __LINE__)
+#define GRPC_FD_UNREF(fd, reason) grpc_fd_unref(fd, reason, __FILE__, __LINE__)
+#else
+void grpc_fd_ref(grpc_fd *fd);
+void grpc_fd_unref(grpc_fd *fd);
+#define GRPC_FD_REF(fd, reason) grpc_fd_ref(fd)
+#define GRPC_FD_UNREF(fd, reason) grpc_fd_unref(fd)
+#endif
+
+void grpc_fd_global_init(void);
+void grpc_fd_global_shutdown(void);
+
#define CLOSURE_NOT_READY ((grpc_closure *)0)
#define CLOSURE_READY ((grpc_closure *)1)
diff --git a/src/core/iomgr/ev_poll_and_epoll_posix.h b/src/core/iomgr/ev_poll_and_epoll_posix.h
new file mode 100644
index 0000000000..e70807a21c
--- /dev/null
+++ b/src/core/iomgr/ev_poll_and_epoll_posix.h
@@ -0,0 +1,37 @@
+/*
+ *
+ * Copyright 2015-2016, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+ #ifndef GRPC_INTERNAL_CORE_IOMGR_EV_POLL_AND_EPOLL_POSIX_H
+ #define GRPC_INTERNAL_CORE_IOMGR_EV_POLL_AND_EPOLL_POSIX_H
+
+ #endif // GRPC_INTERNAL_CORE_IOMGR_EV_POLL_AND_EPOLL_POSIX_H
diff --git a/src/core/iomgr/ev_posix.c b/src/core/iomgr/ev_posix.c
new file mode 100644
index 0000000000..714f24b363
--- /dev/null
+++ b/src/core/iomgr/ev_posix.c
@@ -0,0 +1,32 @@
+/*
+ *
+ * Copyright 2015-2016, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
diff --git a/src/core/iomgr/ev_posix.h b/src/core/iomgr/ev_posix.h
new file mode 100644
index 0000000000..c1e09dae1f
--- /dev/null
+++ b/src/core/iomgr/ev_posix.h
@@ -0,0 +1,97 @@
+/*
+ *
+ * Copyright 2015-2016, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef GRPC_INTERNAL_CORE_IOMGR_EV_POSIX_H
+#define GRPC_INTERNAL_CORE_IOMGR_EV_POSIX_H
+
+typedef struct grpc_fd grpc_fd;
+
+typedef struct grpc_event_engine_vtable {
+ grpc_fd *(*fd_create)(int fd, const char *name);
+ int (*fd_wrapped_fd)(grpc_fd *fd);
+ void (*fd_orphan)(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_closure *on_done,
+ int *release_fd, const char *reason);
+ void (*fd_shutdown)(grpc_exec_ctx *exec_ctx, grpc_fd *fd);
+ void (*fd_notify_on_read)(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
+ grpc_closure *closure);
+ void (*fd_notify_on_write)(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
+ grpc_closure *closure);
+} grpc_event_engine_vtable;
+
+extern const grpc_event_engine_vtable *grpc_event_engine;
+
+void grpc_event_engine_init(void);
+void grpc_event_engine_shutdown(void);
+
+/* Create a wrapped file descriptor.
+ Requires fd is a non-blocking file descriptor.
+ This takes ownership of closing fd. */
+grpc_fd *grpc_fd_create(int fd, const char *name);
+
+/* Return the wrapped fd, or -1 if it has been released or closed. */
+int grpc_fd_wrapped_fd(grpc_fd *fd);
+
+/* Releases fd to be asynchronously destroyed.
+ on_done is called when the underlying file descriptor is definitely close()d.
+ If on_done is NULL, no callback will be made.
+ If release_fd is not NULL, it's set to fd and fd will not be closed.
+ Requires: *fd initialized; no outstanding notify_on_read or
+ notify_on_write.
+ MUST NOT be called with a pollset lock taken */
+void grpc_fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_closure *on_done,
+ int *release_fd, const char *reason);
+
+/* Cause any current callbacks to error out with GRPC_CALLBACK_CANCELLED. */
+void grpc_fd_shutdown(grpc_exec_ctx *exec_ctx, grpc_fd *fd);
+
+/* Register read interest, causing read_cb to be called once when fd becomes
+ readable, on deadline specified by deadline, or on shutdown triggered by
+ grpc_fd_shutdown.
+ read_cb will be called with read_cb_arg when *fd becomes readable.
+ read_cb is Called with status of GRPC_CALLBACK_SUCCESS if readable,
+ GRPC_CALLBACK_TIMED_OUT if the call timed out,
+ and CANCELLED if the call was cancelled.
+
+ Requires:This method must not be called before the read_cb for any previous
+ call runs. Edge triggered events are used whenever they are supported by the
+ underlying platform. This means that users must drain fd in read_cb before
+ calling notify_on_read again. Users are also expected to handle spurious
+ events, i.e read_cb is called while nothing can be readable from fd */
+void grpc_fd_notify_on_read(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
+ grpc_closure *closure);
+
+/* Exactly the same semantics as above, except based on writable events. */
+void grpc_fd_notify_on_write(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
+ grpc_closure *closure);
+
+#endif // GRPC_INTERNAL_CORE_IOMGR_EV_POSIX_H
diff --git a/src/core/iomgr/fd_posix.h b/src/core/iomgr/fd_posix.h
deleted file mode 100644
index 17e7de88ff..0000000000
--- a/src/core/iomgr/fd_posix.h
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- *
- * Copyright 2015-2016, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef GRPC_INTERNAL_CORE_IOMGR_FD_POSIX_H
-#define GRPC_INTERNAL_CORE_IOMGR_FD_POSIX_H
-
-#include "src/core/iomgr/iomgr_internal.h"
-#include "src/core/iomgr/pollset.h"
-#include <grpc/support/atm.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/time.h>
-
-typedef struct grpc_fd grpc_fd;
-
-typedef struct grpc_fd_watcher {
- struct grpc_fd_watcher *next;
- struct grpc_fd_watcher *prev;
- grpc_pollset *pollset;
- grpc_pollset_worker *worker;
- grpc_fd *fd;
-} grpc_fd_watcher;
-
-struct grpc_fd {
- int fd;
- /* refst format:
- bit0: 1=active/0=orphaned
- bit1-n: refcount
- meaning that mostly we ref by two to avoid altering the orphaned bit,
- and just unref by 1 when we're ready to flag the object as orphaned */
- gpr_atm refst;
-
- gpr_mu mu;
- int shutdown;
- int closed;
- int released;
-
- /* The watcher list.
-
- The following watcher related fields are protected by watcher_mu.
-
- An fd_watcher is an ephemeral object created when an fd wants to
- begin polling, and destroyed after the poll.
-
- It denotes the fd's interest in whether to read poll or write poll
- or both or neither on this fd.
-
- If a watcher is asked to poll for reads or writes, the read_watcher
- or write_watcher fields are set respectively. A watcher may be asked
- to poll for both, in which case both fields will be set.
-
- read_watcher and write_watcher may be NULL if no watcher has been
- asked to poll for reads or writes.
-
- If an fd_watcher is not asked to poll for reads or writes, it's added
- to a linked list of inactive watchers, rooted at inactive_watcher_root.
- If at a later time there becomes need of a poller to poll, one of
- the inactive pollers may be kicked out of their poll loops to take
- that responsibility. */
- grpc_fd_watcher inactive_watcher_root;
- grpc_fd_watcher *read_watcher;
- grpc_fd_watcher *write_watcher;
-
- grpc_closure *read_closure;
- grpc_closure *write_closure;
-
- struct grpc_fd *freelist_next;
-
- grpc_closure *on_done_closure;
-
- grpc_iomgr_object iomgr_object;
-};
-
-/* Create a wrapped file descriptor.
- Requires fd is a non-blocking file descriptor.
- This takes ownership of closing fd. */
-grpc_fd *grpc_fd_create(int fd, const char *name);
-
-/* Return the wrapped fd, or -1 if it has been released or closed. */
-int grpc_fd_wrapped_fd(grpc_fd *fd);
-
-/* Releases fd to be asynchronously destroyed.
- on_done is called when the underlying file descriptor is definitely close()d.
- If on_done is NULL, no callback will be made.
- If release_fd is not NULL, it's set to fd and fd will not be closed.
- Requires: *fd initialized; no outstanding notify_on_read or
- notify_on_write.
- MUST NOT be called with a pollset lock taken */
-void grpc_fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_closure *on_done,
- int *release_fd, const char *reason);
-
-/* Begin polling on an fd.
- Registers that the given pollset is interested in this fd - so that if read
- or writability interest changes, the pollset can be kicked to pick up that
- new interest.
- Return value is:
- (fd_needs_read? read_mask : 0) | (fd_needs_write? write_mask : 0)
- i.e. a combination of read_mask and write_mask determined by the fd's current
- interest in said events.
- Polling strategies that do not need to alter their behavior depending on the
- fd's current interest (such as epoll) do not need to call this function.
- MUST NOT be called with a pollset lock taken */
-uint32_t grpc_fd_begin_poll(grpc_fd *fd, grpc_pollset *pollset,
- grpc_pollset_worker *worker, uint32_t read_mask,
- uint32_t write_mask, grpc_fd_watcher *rec);
-/* Complete polling previously started with grpc_fd_begin_poll
- MUST NOT be called with a pollset lock taken
- if got_read or got_write are 1, also does the become_{readable,writable} as
- appropriate. */
-void grpc_fd_end_poll(grpc_exec_ctx *exec_ctx, grpc_fd_watcher *rec,
- int got_read, int got_write);
-
-/* Return 1 if this fd is orphaned, 0 otherwise */
-int grpc_fd_is_orphaned(grpc_fd *fd);
-
-/* Cause any current callbacks to error out with GRPC_CALLBACK_CANCELLED. */
-void grpc_fd_shutdown(grpc_exec_ctx *exec_ctx, grpc_fd *fd);
-
-/* Register read interest, causing read_cb to be called once when fd becomes
- readable, on deadline specified by deadline, or on shutdown triggered by
- grpc_fd_shutdown.
- read_cb will be called with read_cb_arg when *fd becomes readable.
- read_cb is Called with status of GRPC_CALLBACK_SUCCESS if readable,
- GRPC_CALLBACK_TIMED_OUT if the call timed out,
- and CANCELLED if the call was cancelled.
-
- Requires:This method must not be called before the read_cb for any previous
- call runs. Edge triggered events are used whenever they are supported by the
- underlying platform. This means that users must drain fd in read_cb before
- calling notify_on_read again. Users are also expected to handle spurious
- events, i.e read_cb is called while nothing can be readable from fd */
-void grpc_fd_notify_on_read(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
- grpc_closure *closure);
-
-/* Exactly the same semantics as above, except based on writable events. */
-void grpc_fd_notify_on_write(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
- grpc_closure *closure);
-
-/* Notification from the poller to an fd that it has become readable or
- writable.
- If allow_synchronous_callback is 1, allow running the fd callback inline
- in this callstack, otherwise register an asynchronous callback and return */
-void grpc_fd_become_readable(grpc_exec_ctx *exec_ctx, grpc_fd *fd);
-void grpc_fd_become_writable(grpc_exec_ctx *exec_ctx, grpc_fd *fd);
-
-/* Reference counting for fds */
-/*#define GRPC_FD_REF_COUNT_DEBUG*/
-#ifdef GRPC_FD_REF_COUNT_DEBUG
-void grpc_fd_ref(grpc_fd *fd, const char *reason, const char *file, int line);
-void grpc_fd_unref(grpc_fd *fd, const char *reason, const char *file, int line);
-#define GRPC_FD_REF(fd, reason) grpc_fd_ref(fd, reason, __FILE__, __LINE__)
-#define GRPC_FD_UNREF(fd, reason) grpc_fd_unref(fd, reason, __FILE__, __LINE__)
-#else
-void grpc_fd_ref(grpc_fd *fd);
-void grpc_fd_unref(grpc_fd *fd);
-#define GRPC_FD_REF(fd, reason) grpc_fd_ref(fd)
-#define GRPC_FD_UNREF(fd, reason) grpc_fd_unref(fd)
-#endif
-
-void grpc_fd_global_init(void);
-void grpc_fd_global_shutdown(void);
-
-#endif /* GRPC_INTERNAL_CORE_IOMGR_FD_POSIX_H */
diff --git a/src/core/iomgr/iomgr_posix.c b/src/core/iomgr/iomgr_posix.c
index fecb7b9760..f1094f5a48 100644
--- a/src/core/iomgr/iomgr_posix.c
+++ b/src/core/iomgr/iomgr_posix.c
@@ -37,7 +37,7 @@
#include "src/core/iomgr/iomgr_posix.h"
#include "src/core/debug/trace.h"
-#include "src/core/iomgr/fd_posix.h"
+#include "src/core/iomgr/ev_posix.h"
#include "src/core/iomgr/tcp_posix.h"
void grpc_iomgr_platform_init(void) {
diff --git a/src/core/iomgr/pollset_multipoller_with_epoll.c b/src/core/iomgr/pollset_multipoller_with_epoll.c
index 4acae2bb71..e7d3708ecd 100644
--- a/src/core/iomgr/pollset_multipoller_with_epoll.c
+++ b/src/core/iomgr/pollset_multipoller_with_epoll.c
@@ -44,7 +44,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
-#include "src/core/iomgr/fd_posix.h"
+#include "src/core/iomgr/ev_posix.h"
#include "src/core/profiling/timers.h"
#include "src/core/support/block_annotate.h"
diff --git a/src/core/iomgr/pollset_multipoller_with_poll_posix.c b/src/core/iomgr/pollset_multipoller_with_poll_posix.c
index 809f8f39da..80def2c8bf 100644
--- a/src/core/iomgr/pollset_multipoller_with_poll_posix.c
+++ b/src/core/iomgr/pollset_multipoller_with_poll_posix.c
@@ -42,7 +42,7 @@
#include <stdlib.h>
#include <string.h>
-#include "src/core/iomgr/fd_posix.h"
+#include "src/core/iomgr/ev_posix.h"
#include "src/core/iomgr/iomgr_internal.h"
#include "src/core/support/block_annotate.h"
#include <grpc/support/alloc.h>
diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c
index 1063727248..7ac5c20866 100644
--- a/src/core/iomgr/pollset_posix.c
+++ b/src/core/iomgr/pollset_posix.c
@@ -42,7 +42,7 @@
#include <string.h>
#include <unistd.h>
-#include "src/core/iomgr/fd_posix.h"
+#include "src/core/iomgr/ev_posix.h"
#include "src/core/iomgr/iomgr_internal.h"
#include "src/core/iomgr/socket_utils_posix.h"
#include "src/core/profiling/timers.h"
diff --git a/src/core/iomgr/pollset_set_posix.h b/src/core/iomgr/pollset_set_posix.h
index 4820a61e4b..803e58d12c 100644
--- a/src/core/iomgr/pollset_set_posix.h
+++ b/src/core/iomgr/pollset_set_posix.h
@@ -34,7 +34,7 @@
#ifndef GRPC_INTERNAL_CORE_IOMGR_POLLSET_SET_POSIX_H
#define GRPC_INTERNAL_CORE_IOMGR_POLLSET_SET_POSIX_H
-#include "src/core/iomgr/fd_posix.h"
+#include "src/core/iomgr/ev_posix.h"
#include "src/core/iomgr/pollset_posix.h"
typedef struct grpc_pollset_set {
diff --git a/src/core/iomgr/tcp_posix.h b/src/core/iomgr/tcp_posix.h
index 2a40cdd385..7c27141407 100644
--- a/src/core/iomgr/tcp_posix.h
+++ b/src/core/iomgr/tcp_posix.h
@@ -45,7 +45,7 @@
*/
#include "src/core/iomgr/endpoint.h"
-#include "src/core/iomgr/fd_posix.h"
+#include "src/core/iomgr/ev_posix.h"
#define GRPC_TCP_DEFAULT_READ_SLICE_SIZE 8192
diff --git a/src/core/iomgr/udp_server.c b/src/core/iomgr/udp_server.c
index fe006c603c..78116a9d5b 100644
--- a/src/core/iomgr/udp_server.c
+++ b/src/core/iomgr/udp_server.c
@@ -55,7 +55,7 @@
#include <sys/un.h>
#include <unistd.h>
-#include "src/core/iomgr/fd_posix.h"
+#include "src/core/iomgr/ev_posix.h"
#include "src/core/iomgr/pollset_posix.h"
#include "src/core/iomgr/resolve_address.h"
#include "src/core/iomgr/sockaddr_utils.h"
diff --git a/src/core/iomgr/workqueue_posix.c b/src/core/iomgr/workqueue_posix.c
index da11df67ef..b8854ba5e5 100644
--- a/src/core/iomgr/workqueue_posix.c
+++ b/src/core/iomgr/workqueue_posix.c
@@ -43,7 +43,7 @@
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
-#include "src/core/iomgr/fd_posix.h"
+#include "src/core/iomgr/ev_posix.h"
static void on_readable(grpc_exec_ctx *exec_ctx, void *arg, bool success);
diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py
index 8e90f7a61d..d78c0fa22e 100644
--- a/src/python/grpcio/grpc_core_dependencies.py
+++ b/src/python/grpcio/grpc_core_dependencies.py
@@ -132,9 +132,10 @@ CORE_SOURCE_FILES = [
'src/core/iomgr/endpoint.c',
'src/core/iomgr/endpoint_pair_posix.c',
'src/core/iomgr/endpoint_pair_windows.c',
+ 'src/core/iomgr/ev_poll_and_epoll_posix.c',
+ 'src/core/iomgr/ev_posix.c',
'src/core/iomgr/exec_ctx.c',
'src/core/iomgr/executor.c',
- 'src/core/iomgr/fd_posix.c',
'src/core/iomgr/iocp_windows.c',
'src/core/iomgr/iomgr.c',
'src/core/iomgr/iomgr_posix.c',
diff --git a/test/core/iomgr/fd_posix_test.c b/test/core/iomgr/fd_posix_test.c
index 347a86af10..5d73b2c404 100644
--- a/test/core/iomgr/fd_posix_test.c
+++ b/test/core/iomgr/fd_posix_test.c
@@ -31,7 +31,7 @@
*
*/
-#include "src/core/iomgr/fd_posix.h"
+#include "src/core/iomgr/ev_posix.h"
#include <ctype.h>
#include <errno.h>
diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal
index ffc40dfc19..a9847d9cdb 100644
--- a/tools/doxygen/Doxyfile.core.internal
+++ b/tools/doxygen/Doxyfile.core.internal
@@ -823,9 +823,10 @@ src/core/httpcli/parser.h \
src/core/iomgr/closure.h \
src/core/iomgr/endpoint.h \
src/core/iomgr/endpoint_pair.h \
+src/core/iomgr/ev_poll_and_epoll_posix.h \
+src/core/iomgr/ev_posix.h \
src/core/iomgr/exec_ctx.h \
src/core/iomgr/executor.h \
-src/core/iomgr/fd_posix.h \
src/core/iomgr/iocp_windows.h \
src/core/iomgr/iomgr.h \
src/core/iomgr/iomgr_internal.h \
@@ -960,9 +961,10 @@ src/core/iomgr/closure.c \
src/core/iomgr/endpoint.c \
src/core/iomgr/endpoint_pair_posix.c \
src/core/iomgr/endpoint_pair_windows.c \
+src/core/iomgr/ev_poll_and_epoll_posix.c \
+src/core/iomgr/ev_posix.c \
src/core/iomgr/exec_ctx.c \
src/core/iomgr/executor.c \
-src/core/iomgr/fd_posix.c \
src/core/iomgr/iocp_windows.c \
src/core/iomgr/iomgr.c \
src/core/iomgr/iomgr_posix.c \
diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json
index fdba0417ca..bcd49dc9c6 100644
--- a/tools/run_tests/sources_and_headers.json
+++ b/tools/run_tests/sources_and_headers.json
@@ -3005,9 +3005,10 @@
"src/core/iomgr/closure.h",
"src/core/iomgr/endpoint.h",
"src/core/iomgr/endpoint_pair.h",
+ "src/core/iomgr/ev_poll_and_epoll_posix.h",
+ "src/core/iomgr/ev_posix.h",
"src/core/iomgr/exec_ctx.h",
"src/core/iomgr/executor.h",
- "src/core/iomgr/fd_posix.h",
"src/core/iomgr/iocp_windows.h",
"src/core/iomgr/iomgr.h",
"src/core/iomgr/iomgr_internal.h",
@@ -3194,12 +3195,14 @@
"src/core/iomgr/endpoint_pair.h",
"src/core/iomgr/endpoint_pair_posix.c",
"src/core/iomgr/endpoint_pair_windows.c",
+ "src/core/iomgr/ev_poll_and_epoll_posix.c",
+ "src/core/iomgr/ev_poll_and_epoll_posix.h",
+ "src/core/iomgr/ev_posix.c",
+ "src/core/iomgr/ev_posix.h",
"src/core/iomgr/exec_ctx.c",
"src/core/iomgr/exec_ctx.h",
"src/core/iomgr/executor.c",
"src/core/iomgr/executor.h",
- "src/core/iomgr/fd_posix.c",
- "src/core/iomgr/fd_posix.h",
"src/core/iomgr/iocp_windows.c",
"src/core/iomgr/iocp_windows.h",
"src/core/iomgr/iomgr.c",
@@ -3528,9 +3531,10 @@
"src/core/iomgr/closure.h",
"src/core/iomgr/endpoint.h",
"src/core/iomgr/endpoint_pair.h",
+ "src/core/iomgr/ev_poll_and_epoll_posix.h",
+ "src/core/iomgr/ev_posix.h",
"src/core/iomgr/exec_ctx.h",
"src/core/iomgr/executor.h",
- "src/core/iomgr/fd_posix.h",
"src/core/iomgr/iocp_windows.h",
"src/core/iomgr/iomgr.h",
"src/core/iomgr/iomgr_internal.h",
@@ -3701,12 +3705,14 @@
"src/core/iomgr/endpoint_pair.h",
"src/core/iomgr/endpoint_pair_posix.c",
"src/core/iomgr/endpoint_pair_windows.c",
+ "src/core/iomgr/ev_poll_and_epoll_posix.c",
+ "src/core/iomgr/ev_poll_and_epoll_posix.h",
+ "src/core/iomgr/ev_posix.c",
+ "src/core/iomgr/ev_posix.h",
"src/core/iomgr/exec_ctx.c",
"src/core/iomgr/exec_ctx.h",
"src/core/iomgr/executor.c",
"src/core/iomgr/executor.h",
- "src/core/iomgr/fd_posix.c",
- "src/core/iomgr/fd_posix.h",
"src/core/iomgr/iocp_windows.c",
"src/core/iomgr/iocp_windows.h",
"src/core/iomgr/iomgr.c",
diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj
index 8e8f29aee9..5fdacc12ea 100644
--- a/vsprojects/vcxproj/grpc/grpc.vcxproj
+++ b/vsprojects/vcxproj/grpc/grpc.vcxproj
@@ -332,9 +332,10 @@
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\closure.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\endpoint.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\endpoint_pair.h" />
+ <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\ev_poll_and_epoll_posix.h" />
+ <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\ev_posix.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\exec_ctx.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\executor.h" />
- <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\fd_posix.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\iocp_windows.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\iomgr.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\iomgr_internal.h" />
@@ -530,12 +531,14 @@
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\iomgr\endpoint_pair_windows.c">
</ClCompile>
+ <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\ev_poll_and_epoll_posix.c">
+ </ClCompile>
+ <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\ev_posix.c">
+ </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\iomgr\exec_ctx.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\iomgr\executor.c">
</ClCompile>
- <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\fd_posix.c">
- </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\iomgr\iocp_windows.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\iomgr\iomgr.c">
diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters
index e55c6673ce..3f008aae99 100644
--- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters
+++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters
@@ -178,13 +178,16 @@
<ClCompile Include="$(SolutionDir)\..\src\core\iomgr\endpoint_pair_windows.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>
- <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\exec_ctx.c">
+ <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\ev_poll_and_epoll_posix.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>
- <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\executor.c">
+ <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\ev_posix.c">
+ <Filter>src\core\iomgr</Filter>
+ </ClCompile>
+ <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\exec_ctx.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>
- <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\fd_posix.c">
+ <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\executor.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\iomgr\iocp_windows.c">
@@ -653,13 +656,16 @@
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\endpoint_pair.h">
<Filter>src\core\iomgr</Filter>
</ClInclude>
- <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\exec_ctx.h">
+ <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\ev_poll_and_epoll_posix.h">
<Filter>src\core\iomgr</Filter>
</ClInclude>
- <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\executor.h">
+ <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\ev_posix.h">
+ <Filter>src\core\iomgr</Filter>
+ </ClInclude>
+ <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\exec_ctx.h">
<Filter>src\core\iomgr</Filter>
</ClInclude>
- <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\fd_posix.h">
+ <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\executor.h">
<Filter>src\core\iomgr</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\iocp_windows.h">
diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj
index af89435885..425daa2ad9 100644
--- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj
+++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj
@@ -308,9 +308,10 @@
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\closure.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\endpoint.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\endpoint_pair.h" />
+ <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\ev_poll_and_epoll_posix.h" />
+ <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\ev_posix.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\exec_ctx.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\executor.h" />
- <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\fd_posix.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\iocp_windows.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\iomgr.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\iomgr_internal.h" />
@@ -466,12 +467,14 @@
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\iomgr\endpoint_pair_windows.c">
</ClCompile>
+ <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\ev_poll_and_epoll_posix.c">
+ </ClCompile>
+ <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\ev_posix.c">
+ </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\iomgr\exec_ctx.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\iomgr\executor.c">
</ClCompile>
- <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\fd_posix.c">
- </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\iomgr\iocp_windows.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\iomgr\iomgr.c">
diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters
index 809ea59c5f..ce8f74c508 100644
--- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters
+++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters
@@ -118,13 +118,16 @@
<ClCompile Include="$(SolutionDir)\..\src\core\iomgr\endpoint_pair_windows.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>
- <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\exec_ctx.c">
+ <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\ev_poll_and_epoll_posix.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>
- <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\executor.c">
+ <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\ev_posix.c">
+ <Filter>src\core\iomgr</Filter>
+ </ClCompile>
+ <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\exec_ctx.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>
- <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\fd_posix.c">
+ <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\executor.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\iomgr\iocp_windows.c">
@@ -548,13 +551,16 @@
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\endpoint_pair.h">
<Filter>src\core\iomgr</Filter>
</ClInclude>
- <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\exec_ctx.h">
+ <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\ev_poll_and_epoll_posix.h">
<Filter>src\core\iomgr</Filter>
</ClInclude>
- <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\executor.h">
+ <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\ev_posix.h">
+ <Filter>src\core\iomgr</Filter>
+ </ClInclude>
+ <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\exec_ctx.h">
<Filter>src\core\iomgr</Filter>
</ClInclude>
- <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\fd_posix.h">
+ <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\executor.h">
<Filter>src\core\iomgr</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\iocp_windows.h">