Browse files

added note on sending of messages in callback

  • Loading branch information...
1 parent 24580af commit 91644e3530a4c0e89bbb01aafb34b91c41ec4668 Bela Ban committed Nov 22, 2010
Showing with 16 additions and 0 deletions.
  1. +16 −0 doc/manual/en/modules/api.xml
@@ -132,6 +132,22 @@
Note that block() should be brief, or else the entire FLUSH protocol is blocked.
+ <note>
+ <title>Sending messages in callbacks</title>
+ <para>
+ Note that anything that could block should <emphasis>not</emphasis> be done in a callback.
+ This includes sending of messages;
+ if we have FLUSH on the stack, and send a message in a viewAccepted() callback, then the following
+ happens: the FLUSH protocol blocks all (multicast) messages before installing a view, then installs
+ the view, then unblocks. However, because installation of the view triggers the viewAccepted() callback,
+ sending of messages inside of viewAccepted() will block. This in turn blocks the viewAccepted() thread,
+ so the flush will never return !
+ </para>
+ <para>
+ If we need to send a message in a callback, the sending should be done on a separate thread, or a timer
+ task should be submitted to the timer.
+ </para>
+ </note>

0 comments on commit 91644e3

Please sign in to comment.