Index: trunk/kernel/libk/remote_fifo.h
===================================================================
--- trunk/kernel/libk/remote_fifo.h	(revision 279)
+++ trunk/kernel/libk/remote_fifo.h	(revision 407)
@@ -28,22 +28,27 @@
 #include <kernel_config.h>
 #include <hal_types.h>
+#include <printk.h>
 #include <errno.h>
 #include <hal_remote.h>
 
 /************************************************************************************
- * This structure defines a generic, single reader, multiple writers
- * remote FIFO, that is used by the RPCs for inter cluster communications.
- * The accesses are implemented using a lock-free algorithm, as it uses a ticket 
- * based mechanism to handle concurrent access between multiple writers.
- * Each FIF0 slot can contain one 64 bits integer.
- * In case of FIFO full, the writer deschedule without blocking, to retry later.
- *
- * WARNING : the number of slots is statically defined by the global 
- * configuration parameter CONFIG_REMOTE_FIFO_SLOTS for all fifos. requiring
- * Each FIFO requires 8 + (12 * CONFIG_REMOTE_FIFO_SLOTS) bytes.
+ * This structure defines a generic, single reader, multiple writers FIFO,
+ * that is used for - RPC based - inter cluster communications.
+ * Each FIF0 slot can contain one 64 bits integer (or one extended pointer).
+ * The number of slots is defined by the CONFIG_REMOTE_FIFO_SLOTS parameter.
+ * - The write accesses are implemented using a lock-free algorithm, as it uses
+ *   a ticket based mechanism to handle concurrent access between multiple writers.
+ *   In case of FIFO full, the writer deschedule without blocking, to retry later.
+ * - The reader must take the try_lock implemented by the "owner" field, using
+ *   an atomic_add(). The TRDID is a good owner identifier, because all
+ *   RPC threads in a given cluster belong to the same kernel process,
+ *   and RPC threads cannot have local index LTID = 0.
+*
+ * WARNING : Each FIFO requires 12 + (12 * CONFIG_REMOTE_FIFO_SLOTS) bytes.
  ***********************************************************************************/
 
 typedef struct remote_fifo_s
 {
+    uint32_t           owner;                            /*! owner thread trdid    */
 	volatile uint32_t  wr_id;                            /*! write slot index      */
 	volatile uint32_t  rd_id;                            /*! read  slot index      */
@@ -63,5 +68,5 @@
 /************************************************************************************
  * This non blocking function tries to get one item from the local fifo.
- * The reader must get exclusive access before calling this function.  
+ * The reader must get exclusive access for read before calling this function.  
  * The read slot index is incremented.
  ************************************************************************************
@@ -75,17 +80,16 @@
 /************************************************************************************
  * This blocking function puts one item to a remote fifo identified
- * by an extended pointer.
- * This function gets a write ticket using a remote_atomic_increment on the
- * write slot. Then, it waits until the slot is empty, using a descheduling
- * policy without blocking.
+ * by an extended pointer. It gets a write ticket on the slot to be written,
+ * using a remote_atomic_add() on the write slot index. Then, it waits until
+ * the slot is empty, using a descheduling policy without blocking if required. 
+ * It implements a watchdog, returning when the item has been successfully
+ * registered, or after CONFIG_REMOTE_FIFO_MAX_ITERATIONS failures.   
  ************************************************************************************
  * @ fifo    : extended pointer to the fifo in remote cluster.
  * @ item    : item to be stored.
- * @ first   : [out] true if first item registered in remote fifo.
  * @ return  0 on success / EBUSY if a contention has been detected.
  ***********************************************************************************/
 error_t remote_fifo_put_item( xptr_t     fifo,
-                              uint64_t   item,
-                              bool_t   * first );
+                              uint64_t   item );
 
 /************************************************************************************
