summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorRobert Haas2016-05-09 15:48:11 +0000
committerRobert Haas2016-09-20 16:39:57 +0000
commitdfd040ae58eda766c7e34059f84e42dd3112cc1f (patch)
tree8886c2a2f7e9126baf914190c212f6309d2e6ff7 /src/include
parent771673b608b1ed259a175ecf03e826aaa74808ae (diff)
Lightweight framework for waiting for events.async
Diffstat (limited to 'src/include')
-rw-r--r--src/include/executor/execAsync.h23
-rw-r--r--src/include/executor/executor.h2
-rw-r--r--src/include/nodes/execnodes.h10
3 files changed, 35 insertions, 0 deletions
diff --git a/src/include/executor/execAsync.h b/src/include/executor/execAsync.h
new file mode 100644
index 0000000000..38b37a1d2a
--- /dev/null
+++ b/src/include/executor/execAsync.h
@@ -0,0 +1,23 @@
+/*--------------------------------------------------------------------
+ * execAsync.h
+ * Support functions for asynchronous query execution
+ *
+ * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * IDENTIFICATION
+ * src/include/executor/execAsync.h
+ *--------------------------------------------------------------------
+ */
+
+#ifndef EXECASYNC_H
+#define EXECASYNC_H
+
+#include "nodes/execnodes.h"
+
+extern void ExecAsyncWaitForNode(PlanState *planstate);
+extern void ExecAsyncNeedsWait(PlanState *planstate, int nevents,
+ bool reinit);
+extern void ExecAsyncDoesNotNeedWait(PlanState *planstate);
+
+#endif /* EXECASYNC_H */
diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h
index 1eb09d80a0..7abc361fe5 100644
--- a/src/include/executor/executor.h
+++ b/src/include/executor/executor.h
@@ -223,6 +223,8 @@ extern void EvalPlanQualEnd(EPQState *epqstate);
*/
extern PlanState *ExecInitNode(Plan *node, EState *estate, PlanState *parent,
int eflags);
+extern void ExecDispatchNode(PlanState *node);
+extern void ExecExecuteNode(PlanState *node);
extern TupleTableSlot *ExecProcNode(PlanState *node);
extern Node *MultiExecProcNode(PlanState *node);
extern void ExecEndNode(PlanState *node);
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index b14aa7a306..d0c7cfc300 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -383,6 +383,14 @@ typedef struct EState
ParamListInfo es_param_list_info; /* values of external params */
ParamExecData *es_param_exec_vals; /* values of internal params */
+ /* Asynchronous execution support */
+ struct PlanState **es_waiting_nodes; /* array of waiting nodes */
+ int es_num_waiting_nodes; /* # of waiters in array */
+ int es_max_waiting_nodes; /* # of allocated entries */
+ int es_total_async_events; /* total of per-node n_async_events */
+ int es_max_async_events; /* # supported by event set */
+ struct WaitEventSet *es_wait_event_set;
+
/* Other working state: */
MemoryContext es_query_cxt; /* per-query context in which EState lives */
@@ -1035,6 +1043,8 @@ typedef struct PlanState
bool result_ready; /* true if result is ready */
Node *result; /* result, most often TupleTableSlot */
+ int n_async_events; /* # of async events we want to register */
+
Instrumentation *instrument; /* Optional runtime stats for this node */
WorkerInstrumentation *worker_instrument; /* per-worker instrumentation */