aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-07-13 20:13:19 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-07-13 20:13:19 -0700
commit5d0c1f0da22cd42c3a10e566f3addb126ba58c15 (patch)
tree6c3902f012c2f9ac9696fb7b8074521ad27dc6a1
parent8da7b1f779b36394008aad5ef40f49b03ce79c7b (diff)
Describe workqueue_enqueue better
-rw-r--r--src/core/lib/iomgr/workqueue.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core/lib/iomgr/workqueue.h b/src/core/lib/iomgr/workqueue.h
index 9f7219ebf1..67490b4158 100644
--- a/src/core/lib/iomgr/workqueue.h
+++ b/src/core/lib/iomgr/workqueue.h
@@ -50,6 +50,8 @@
/* grpc_workqueue is forward declared in exec_ctx.h */
+/* Deprecated: do not use.
+ This has *already* been removed in a future commit. */
void grpc_workqueue_flush(grpc_exec_ctx *exec_ctx, grpc_workqueue *workqueue);
//#define GRPC_WORKQUEUE_REFCOUNT_DEBUG
@@ -69,7 +71,16 @@ void grpc_workqueue_ref(grpc_workqueue *workqueue);
void grpc_workqueue_unref(grpc_exec_ctx *exec_ctx, grpc_workqueue *workqueue);
#endif
-/** Add a work item to a workqueue */
+/** Add a work item to a workqueue. Items added to a work queue will be started
+ in approximately the order they were enqueued, on some thread that may or
+ may not be the current thread. Successive closures enqueued onto a workqueue
+ MAY be executed concurrently.
+
+ It is generally more expensive to add a closure to a workqueue than to the
+ execution context, both in terms of CPU work and in execution latency.
+
+ Use work queues when it's important that other threads be given a chance to
+ tackle some workload. */
void grpc_workqueue_enqueue(grpc_exec_ctx *exec_ctx, grpc_workqueue *workqueue,
grpc_closure *closure, grpc_error *error);