Changeset d39cd1e for lib


Ignore:
Timestamp:
11/10/17 15:19:55 (3 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
cachetimestamps, develop, dpdk-ndag, etsilive, master, ndag_format, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance
Children:
b34f924
Parents:
4bab977
Message:

Try to only check for control messages once per user read call.

Checking for messages once for each packet when we're doing a
10 packet max batch read is a bit of wasted time.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_ndag.c

    r4bab977 rd39cd1e  
    887887                }
    888888
    889                 /* First, check for any messages from the control thread */
    890                 iserr = receiver_read_messages(rt);
    891 
    892                 if (iserr <= 0) {
    893                         return iserr;
     889                /* Check for any messages from the control thread */
     890                if (block) {
     891                        iserr = receiver_read_messages(rt);
     892
     893                        if (iserr <= 0) {
     894                                return iserr;
     895                        }
    894896                }
    895897
     
    991993        rt = (recvstream_t *)t->format_data;
    992994
     995        /* Only check for messages once per batch */
     996        rem = receiver_read_messages(rt);
     997        if (rem <= 0) {
     998                return rem;
     999        }
     1000
    9931001        do {
    9941002                rem = receive_encap_records(libtrace, rt,
     
    10291037        int rem;
    10301038        streamsock_t *nextavail = NULL;
     1039
     1040        /* Only check for messages once per batch */
     1041        rem = receiver_read_messages(&(FORMAT_DATA->receivers[0]));
     1042        if (rem <= 0) {
     1043                event.type = TRACE_EVENT_TERMINATE;
     1044                return event;
     1045        }
    10311046
    10321047        do {
Note: See TracChangeset for help on using the changeset viewer.