Commit b2a66424 authored by Joanne Hugé's avatar Joanne Hugé

Add comments at the beginning of client and server files

parent 702faf9e
#define _GNU_SOURCE
/*
* Real time packet sending thread
*
* Bash options:
*
* -a Run the real time thread on CPU1
* -i USEC Wake up the real time thread every USEC microseconds
* -l N Wake up the real time thread N times
* -p PRIO Run the real time thread at priority PRIO
* -r USEC Refresh the non real time main thread every USEC microseconds
*
*/
#include <errno.h>
#include <error.h>
#include <pthread.h>
......@@ -13,6 +23,8 @@
#include "send_packet.h"
#define _GNU_SOURCE
#define CLOCK_ID CLOCK_MONOTONIC
#define NSEC_PER_SEC UINT64_C(1000000000)
......@@ -46,7 +58,7 @@ static void *packet_sending_thread(void *p) {
thread_param_t *param = (thread_param_t *)p;
cpu_set_t mask;
if(param->enable_affinity) {
if (param->enable_affinity) {
// Set thread CPU affinity
CPU_ZERO(&mask);
CPU_SET(1, &mask);
......
#define _GNU_SOURCE
/*
* Real time packet receiving thread
*
* Bash options:
*
* -a Run the real time thread on CPU1
* -p PRIO Run the real time thread at priority PRIO
* -r USEC Refresh the non real time main thread every USEC microseconds
*
*/
#include <arpa/inet.h>
#include <errno.h>
......@@ -17,6 +26,8 @@
#include <time.h>
#include <unistd.h>
#define _GNU_SOURCE
#define NSEC_PER_SEC UINT64_C(1000000000)
#define SERVER_PORT "50000"
......@@ -69,7 +80,7 @@ static void *packet_receiving_thread(void *p) {
stats->min_interval = UINT64_MAX;
stats->max_interval = 0;
if(param->enable_affinity) {
if (param->enable_affinity) {
// Set thread CPU affinity
CPU_ZERO(&mask);
CPU_SET(1, &mask);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment