pollset_windows.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPC_CORE_LIB_IOMGR_POLLSET_WINDOWS_H
20 #define GRPC_CORE_LIB_IOMGR_POLLSET_WINDOWS_H
21 
23 
24 #include <grpc/support/sync.h>
25 
27 
28 #ifdef GRPC_WINSOCK_SOCKET
30 
31 /* There isn't really any such thing as a pollset under Windows, due to the
32  nature of the IO completion ports. A Windows "pollset" is merely a mutex
33  used to synchronize with the IOCP, and workers are condition variables
34  used to block threads until work is ready. */
35 
36 typedef enum {
37  GRPC_POLLSET_WORKER_LINK_POLLSET = 0,
38  GRPC_POLLSET_WORKER_LINK_GLOBAL,
39  GRPC_POLLSET_WORKER_LINK_TYPES
40 } grpc_pollset_worker_link_type;
41 
42 typedef struct grpc_pollset_worker_link {
43  struct grpc_pollset_worker* next;
44  struct grpc_pollset_worker* prev;
45 } grpc_pollset_worker_link;
46 
47 struct grpc_pollset;
48 typedef struct grpc_pollset grpc_pollset;
49 
50 typedef struct grpc_pollset_worker {
51  gpr_cv cv;
52  int kicked;
53  struct grpc_pollset* pollset;
54  grpc_pollset_worker_link links[GRPC_POLLSET_WORKER_LINK_TYPES];
56 
57 struct grpc_pollset {
58  int shutting_down;
59  int kicked_without_pollers;
60  int is_iocp_worker;
61  grpc_pollset_worker root_worker;
62  grpc_closure* on_shutdown;
63 };
64 
65 void grpc_pollset_global_init(void);
67 
68 #endif
69 
70 #endif /* GRPC_CORE_LIB_IOMGR_POLLSET_WINDOWS_H */
grpc_pollset_worker
struct grpc_pollset_worker grpc_pollset_worker
Definition: pollset.h:39
gpr_cv
pthread_cond_t gpr_cv
Definition: impl/codegen/sync_posix.h:48
socket_windows.h
grpc_pollset_global_shutdown
void grpc_pollset_global_shutdown()
Definition: pollset.cc:31
grpc_pollset_global_init
void grpc_pollset_global_init()
Definition: pollset.cc:29
cv
unsigned cv
Definition: cxa_demangle.cpp:4908
port.h
next
AllocList * next[kMaxLevel]
Definition: abseil-cpp/absl/base/internal/low_level_alloc.cc:100
grpc_pollset
Definition: bm_cq_multiple_threads.cc:37
sync.h
grpc_closure
Definition: closure.h:56
port_platform.h


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:00:53