static int kq_master, kq_worker;
static int max_messages = 10;
static int max_outstanding = 1;
+static bool touch_memory = false;
static void NEVER_RETURNS usage(void)
{
num_messages++;
cd->m.when = fr_time();
+
+ if (touch_memory) {
+ size_t j, k;
+
+ for (j = k = 0; j < cd->m.data_size; j++) {
+ k += cd->m.data[j];
+ }
+
+ cd->m.data[4] = k;
+ }
+
memcpy(cd->m.data, &num_messages, sizeof(num_messages));
MPRINT1("Master sent message %d\n", num_messages);
reply->m.when = fr_time();
fr_message_done(&cd->m);
+ if (touch_memory) {
+ size_t j, k;
+
+ for (j = k = 0; j < reply->m.data_size; j++) {
+ k += reply->m.data[j];
+ }
+
+ reply->m.data[4] = k;
+ }
+
+
MPRINT1("\tWorker sending reply to messages %d\n", worker_messages);
rcode = fr_channel_send_reply(channel, reply, &cd);
if (rcode < 0) {
fr_time_start();
- while ((c = getopt(argc, argv, "hm:o:x")) != EOF) switch (c) {
+ while ((c = getopt(argc, argv, "hm:o:tx")) != EOF) switch (c) {
case 'x':
debug_lvl++;
break;
max_outstanding = atoi(optarg);
break;
+ case 't':
+ touch_memory = true;
+ break;
+
case 'h':
default:
usage();