Document prod/consumer synchro
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 24 Aug 2011 20:21:52 +0000 (16:21 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 24 Aug 2011 20:21:52 +0000 (16:21 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
libringbuffer/frontend_internal.h

index 02cb4d4a75d37c4b70f1f515be7fe5a1e18443d9..1fb08dfdec90d3f25e5f7ce85f39c010386badf4 100644 (file)
@@ -386,6 +386,20 @@ void lib_ring_buffer_check_deliver(const struct lib_ring_buffer_config *config,
                                         * Wake-up the other end by
                                         * writing a null byte in the
                                         * pipe (non-blocking).
+                                        * Important note: Because
+                                        * writing into the pipe is
+                                        * non-blocking (and therefore
+                                        * we allow dropping wakeup
+                                        * data, as long as there is
+                                        * wakeup data present in the
+                                        * pipe buffer to wake up the
+                                        * consumer), the consumer
+                                        * should perform the following
+                                        * sequence for waiting:
+                                        * 1) empty the pipe (reads).
+                                        * 2) check if there is data in
+                                        *    the buffer.
+                                        * 3) wait on the pipe (poll).
                                         */
                                        do {
                                                ret = write(wakeup_fd, "", 1);
This page took 0.026497 seconds and 4 git commands to generate.