[master] 9597fcd improve the note on concurrency

Nils Goroll nils.goroll at uplex.de
Fri May 29 13:48:27 CEST 2015


commit 9597fcd10fa947bb35edfc193f24e25b22f8429b
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Fri May 29 13:47:32 2015 +0200

    improve the note on concurrency

diff --git a/bin/varnishd/waiter/cache_waiter_ports.c b/bin/varnishd/waiter/cache_waiter_ports.c
index f44959e..20a636c 100644
--- a/bin/varnishd/waiter/cache_waiter_ports.c
+++ b/bin/varnishd/waiter/cache_waiter_ports.c
@@ -27,18 +27,20 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- */
-
-
-/*
- * XXX questions to discuss with phk - is it really better
+ * On concurrency:
+ *
+ * There are several options for the enter method to add an fd for the waiter
+ * thread to look after:
+ *
+ * - share the binheap (requiring a mutex) - implemented for epoll and kqueues
  *
- * - to share the binheap (requiring the mtx), which epoll / kq do now
+ * - send events to be entered through the events interface and keep the binheap
+ *   private to the waiter thread - implemented here.
  *
- * - than to send events to be entered through the events interface and keep the
- *   binheap private to the waiter thread (which we still do here) ?
+ * - some other message passing / mailbox
  *
- * at best, we can save two port syscalls, but not always:
+ * It has not yet been determined which option is best. In the best case, by
+ * sharing the binheap, we can save two port syscalls - but not always:
  *
  * - if the waited event has a timeout earlier than the first element on the
  *   binheap, we need to kick the waiter thread anyway



More information about the varnish-commit mailing list