stellar support monotonic time and real time

This commit is contained in:
luwenpeng
2024-05-16 10:13:43 +08:00
parent 1ef82a0c6a
commit fdc65067b2
30 changed files with 201 additions and 124 deletions

View File

@@ -4,8 +4,8 @@
#include <pthread.h>
#include <sys/prctl.h>
#include "times.h"
#include "config.h"
#include "timestamp.h"
#include "stellar_priv.h"
struct stellar_runtime __runtime = {0};
@@ -122,7 +122,7 @@ static void *work_thread(void *arg)
while (ATOMIC_READ(&runtime->need_exit) == 0)
{
now = timestamp_get_msec();
now = stellar_get_monotonic_time_msec();
memset(packets, 0, sizeof(packets));
nr_recv = packet_io_ingress(packet_io, thr_idx, packets, RX_BURST_MAX);
if (nr_recv == 0)
@@ -247,7 +247,7 @@ void stellar_set_current_thread_index(uint16_t idx)
int stellar_thread_init(struct stellar_runtime *runtime, struct stellar_config *config)
{
uint64_t now = timestamp_get_msec();
uint64_t now = stellar_get_monotonic_time_msec();
for (uint16_t i = 0; i < config->io_opts.nr_threads; i++)
{
struct stellar_thread *thread = &runtime->threads[i];