Fix mutex/condvar sleep when adding API msgs, VPP-461 65/3265/3
authorDave Barach <dave@barachs.net>
Tue, 4 Oct 2016 20:53:56 +0000 (16:53 -0400)
committerDamjan Marion <dmarion.lists@gmail.com>
Wed, 5 Oct 2016 07:44:47 +0000 (07:44 +0000)
commite91836368cec2ffed47743dc5626e2d0c44fc0ea
tree2963dd4e18d6da168b79e2bf6785b4d851284076
parent15977efc454a2faba91eca0184251dc8e0d553f0
Fix mutex/condvar sleep when adding API msgs, VPP-461

Simply put, threads cannot sleep waiting for the vlib memory api main
input queue to drain. If, say, thread i (i !=0) fills the vlib api
main input queue with rpc requests - and then blocks trying to add
another request - the game is over.

RPCs attempt a barrier synchronization, which fails with Pr = {1.0}
because thread i is in a mutex/condvar sleep.

Add a main-thread cut-through path, which directly invokes the RPC
callback function when called on the main thread.

Change-Id: Ib036f0cc43b5738455c3a111cff64a132537152e
Signed-off-by: Dave Barach <dave@barachs.net>
vlib-api/vlibmemory/memory_vlib.c