calculate per-thread time offset 03/17703/4
authorDave Barach <dave@barachs.net>
Tue, 19 Feb 2019 22:05:30 +0000 (17:05 -0500)
committerDamjan Marion <dmarion@me.com>
Wed, 20 Feb 2019 16:27:47 +0000 (16:27 +0000)
commita4324a996f34902579338033110d27575a654c8e
treecdc4a58a8d055053cf8ef90b5ddf7d0fcd1a5af2
parent51a423dc2b0d4aad0bbd8f7e757d2ca49221ff83
calculate per-thread time offset

The main thread squirrels away vlib_time_now (&vlib_global_main),
worker threads use it to calculate an offset in f64 seconds from their
own vlib_time_now(vm) value. We use that offset until the next barrier
sync.

Thanks to Damjan for the suggestion.

Change-Id: If56cdfe68e5ad8ac3b0d0fc885dc3ba556cd1215
Signed-off-by: Dave Barach <dave@barachs.net>
src/vlib/main.h
src/vlib/threads.c
src/vlib/threads.h