Ignore:
Timestamp:
02/11/15 11:09:31 (7 years ago)
Author:
Richard Sanger <rsangerarj@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
1b59edf
Parents:
858ce90
Message:

Move pthread register outside of the libtrace lock.
DAG does a decent amount of work in this step, which
can be done in parallel. Instead let formats grab a
lock if they need it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace_parallel.c

    r858ce90 r12ae766  
    526526        }
    527527        //printf("Yay Started perpkt thread #%d\n", (int) get_thread_table_num(trace));
     528        ASSERT_RET(pthread_mutex_unlock(&trace->libtrace_lock), == 0);
     529
    528530        if (trace->format->pregister_thread) {
    529531                trace->format->pregister_thread(trace, t, !trace_has_dedicated_hasher(trace));
    530532        }
    531         ASSERT_RET(pthread_mutex_unlock(&trace->libtrace_lock), == 0);
    532533
    533534        /* Fill our buffer with empty packets */
     
    696697        libtrace_packet_t * packet;
    697698        libtrace_message_t message = {0};
     699        int pkt_skipped = 0;
    698700
    699701        assert(trace_has_dedicated_hasher(trace));
     
    709711
    710712        printf("Hasher Thread started\n");
     713        ASSERT_RET(pthread_mutex_unlock(&trace->libtrace_lock), == 0);
     714
    711715        if (trace->format->pregister_thread) {
    712716                trace->format->pregister_thread(trace, t, true);
    713717        }
    714         ASSERT_RET(pthread_mutex_unlock(&trace->libtrace_lock), == 0);
    715         int pkt_skipped = 0;
     718
    716719        /* Read all packets in then hash and queue against the correct thread */
    717720        while (1) {
Note: See TracChangeset for help on using the changeset viewer.