On Fri, Feb 10, 2017 at 11:23 AM, Dave Barach (dbarach) <dbar...@cisco.com>
wrote:

> Dear Jon,
>
>
>
> If you send “please dump X” API message(s), followed by a control-ping
> message: when the control-ping reply appears, all of dump reply messages
> (if any) have appeared.
>
>
>
> That absolutely *does* work. See api_format.c:api_ip_add_del_route(...).
>
>
>
> In standard usage, the messages are received on a separate pthread. The
> api test tool uses the world’s crudest synchronization scheme.
>
>
> Contact me off-list if you can’t figure out what’s wrong.
>
>
>
> Thanks… Dave
>

Dave,

Spurred on by  your insistence that it does work, I went digging
around in my code a whole bunch more.  Specifically, I was trying
to instrument around my message-wait function some more.
Eventually, I came to realize that it was timing-out on almost every
message sent.  Naturally, that didn't seem right to me...

Debugging lead me to realize that I failed to call clib_time_init()
in our early initialization sequence, and all of the timer-based
tests in message wait were instantly failing, and thus the messages
were not truly waiting for the "result ready" condition like they should.

I still don't like the use of an essentially global, volatile here; but
at least it is working, as you indicated it would.

Is there a quick outline of how the API's threading model is set up
and expected to be used?  Where the vlib_global_main and vlib_mains
are established and such?

Thank you!
jdl
_______________________________________________
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Reply via email to