improvement
authorLaurent MAZET <laurent.mazet@thalesgroup.com>
Mon, 20 Oct 2025 14:55:40 +0000 (16:55 +0200)
committerLaurent MAZET <laurent.mazet@thalesgroup.com>
Mon, 20 Oct 2025 14:55:40 +0000 (16:55 +0200)
mq_lat.c
pipe_lat.c
semaphore.c
udp_lat.c

index a89fbf4783d164e8ad38ffe82bc890effc3bd262..45ae801e74b24ed5aa876eb568e7f47bf976198d 100644 (file)
--- a/mq_lat.c
+++ b/mq_lat.c
@@ -61,6 +61,8 @@ void *ping (__attribute__((unused)) void *arg)
         pthread_mutex_lock (&mutex);
         pthread_mutex_unlock (&mutex);
 
+        usleep (TIMER / 2);
+
         sys_timestamp (&ts1);
         if (mq_send (mq_out, msg, MSGLEN, 0) == -1) {
             fprintf (stderr, "ping error: mq_send (%d)\n", i);
index 37030bdc7cfd9a072f0bb28b6f518f36ee8be196..04e2b11b1a49c6422727a7c01a70c33275141a0e 100644 (file)
@@ -52,6 +52,8 @@ void *ping (__attribute__((unused)) void *arg)
         pthread_mutex_lock (&mutex);
         pthread_mutex_unlock (&mutex);
 
+        usleep (TIMER / 2);
+
         sys_timestamp (&ts1);
         if (write (fdout, msg, MSGLEN) == -1) {
             fprintf (stderr, "ping error: write (%d)\n", i);
index 7552ee22fc5dd2bb6dc56d37f90d8e712353fc22..fb3ba16cd5d902c4f7f63752d0c111b725f77cf4 100644 (file)
@@ -46,6 +46,8 @@ void *ping (__attribute__((unused)) void *arg)
         pthread_mutex_lock (&mutex);
         pthread_mutex_unlock (&mutex);
 
+        usleep (TIMER / 2);
+
         sys_timestamp (&ts1);
         sem_post (&sem);
 
index 5762a5d0a848e5b0ae4f41a2a59ad35895a9f245..05d397be5ebb09d6db03b0e3c7d50a3cb9d8fddf 100644 (file)
--- a/udp_lat.c
+++ b/udp_lat.c
@@ -96,6 +96,8 @@ void *ping (__attribute__((unused)) void *arg)
         pthread_mutex_lock (&mutex);
         pthread_mutex_unlock (&mutex);
 
+        usleep (TIMER / 2);
+
         sys_timestamp (&ts1);
         if (sendto (sock, msg, MSGLEN, 0, (struct sockaddr *)&remote, sizeof (remote)) == -1) {
             fprintf (stderr, "ping error: sendto (%d)\n", i);