liberty/support/specpriv-smtx-executive/smtx/units.cpp
/*
 * Description:
 *
 *  Try-commit unit forwards buffered packets to the commit unit, which are now safe to be committed
 *
 * Arguments:
 *
 *  wid - worker id. Should be one of the try_commit
 *  buf - a packet buffer
 *  size - size of the packet buffer
 */
Try-commit unit forwards buffered packets to the commit unit, which are now safe to be committed



worker id. Should be one of the try_commit
buf - a packet buffer
size - size of the packet buffer
Try - commit unit forwards buffered packets to the commit unit which are now safe to be committed worker id . Should be one of the try_commit buf - a packet buffer size - size of the packet buffer
static void forward_values_to_commit(Wid wid, packet* buf, unsigned size)
{
  DBG("\tforward_values_to_commit\n");
#if PROFILE
  uint64_t b = rdtsc();
#endif
  assert( wid >= try_commit_begin );
  queue_t* commit_queue = commit_queues[wid-try_commit_begin];
  unsigned i = 0;
  for ( ; i < size ; i++)
  {
    packet* p = &buf[i];
    DBG("\tbuffered packet %u\n", i);
    packet* new_p = create_packet(wid, p->ptr, p->value, p->size, p->is_write, p->type);
#if PROFILE
    outgoing_bw[wid] += sizeof(packet);
#endif
    DBG("\tnew packet %u, commit_queue headptr: %p tailptr: %p, headval: %p, tailval: %p\n", i, commit_queue->head,
        commit_queue->tail, *(commit_queue->head), *(commit_queue->tail));
    __sw_queue_produce( commit_queue, (void*)new_p );
  }
#if PROFILE
  globals_time[wid] += (rdtsc() - b);
#endif
}
static void forward_values_to_commit ( Wid wid , packet * buf , unsigned size ) { DBG ( " \t \n " ) ; #if PROFILE uint64_t b = rdtsc ( ) ; #endif assert ( wid >= try_commit_begin ) ; queue_t * commit_queue = commit_queues [ wid - try_commit_begin ] ; unsigned i = 0 ; for ( ; i < size ; i ++ ) { packet * p = & buf [ i ] ; DBG ( " \t \n " , i ) ; packet * new_p = create_packet ( wid , p -> ptr , p -> value , p -> size , p -> is_write , p -> type ) ; #if PROFILE outgoing_bw [ wid ] += sizeof ( packet ) ; #endif DBG ( " \t \n " , i , commit_queue -> head , commit_queue -> tail , * ( commit_queue -> head ) , * ( commit_queue -> tail ) ) ; __sw_queue_produce ( commit_queue , ( void * ) new_p ) ; } #if PROFILE globals_time [ wid ] += ( rdtsc ( ) - b ) ; #endif }
Description:
  Try-commit unit forwards buffered packets to the commit unit, which are now safe to be committed
Description : Try - commit unit forwards buffered packets to the commit unit which are now safe to be committed
//DUMPPACKET("\t", p);