コード例 #1
0
ファイル: abi.c プロジェクト: nmldiegues/proteustm
/**
 * Commits all inner transactions nested within the transaction specified by
 * the transaction id parameter.
 */
void _ITM_CALL_CONVENTION _ITM_commitTransactionToId(TX_ARGS
                              const _ITM_transactionId tid,
                              const _ITM_srcLocation *__src)
{
  TX_GET_ABI;
  while ((tx->nesting + 1) > tid)
    int_stm_commit(tx);
}
コード例 #2
0
ファイル: abi.c プロジェクト: HPDCS/stmEnergyOptimization
void _ITM_CALL_CONVENTION _ITM_commitTransaction(
#if defined(TM_GCC)
                             void
#else /* !TM_GCC */
                             TX_ARGS const _ITM_srcLocation *__src
#endif /* !TM_GCC */
                             )
{
  TX_GET_ABI;
  int_stm_commit(tx);
#ifdef TM_DTMC
  tanger_stm_reset_stack();
#endif /* TM_DTMC */
}
コード例 #3
0
ファイル: abi.c プロジェクト: nmldiegues/proteustm
/* TODO This function is not fully compatible, need to delete exception
 * on abort. */
void _ITM_CALL_CONVENTION _ITM_commitTransactionEH(void *exc_ptr)
{
  TX_GET_ABI;
  int_stm_commit(tx);
}
コード例 #4
0
ファイル: abi.c プロジェクト: nmldiegues/proteustm
bool _ITM_CALL_CONVENTION _ITM_tryCommitTransaction(TX_ARGS
                                   const _ITM_srcLocation *__src)
{
  TX_GET_ABI;
  return (int_stm_commit(tx) != 0);
}
コード例 #5
0
ファイル: abi.c プロジェクト: nmldiegues/proteustm
void _ITM_CALL_CONVENTION _ITM_commitTransaction(void)
{
  TX_GET_ABI;
  int_stm_commit(tx);
}
コード例 #6
0
ファイル: stm.c プロジェクト: kunulee/failsafe_heapo_source
_CALLCONV int
stm_commit_tx(stm_tx_t *tx)
{
    return int_stm_commit(tx);
}
コード例 #7
0
ファイル: stm.c プロジェクト: kunulee/failsafe_heapo_source
/*
 * Called by the CURRENT thread to commit a transaction.
 */
_CALLCONV int
stm_commit(void)
{
    TX_GET;
    return int_stm_commit(tx);
}
コード例 #8
0
ファイル: stm.c プロジェクト: HPDCS/stmEnergyOptimization
_CALLCONV int
stm_commit(void)
{
	TX_GET;
	int ret;

	ret=int_stm_commit(tx);

#ifdef STM_SCA
	if(tx->sca_serializing_lock_acquired == 1){
		sca_serializing_lock=0;
		tx->sca_serializing_lock_acquired = 0;
    }

	tx->contention_bit = 0;
    tx->saturating_counter = 0;

    //inc++;
    //printf("Committed: %i\r", inc);
    //fflush(stdout);

#endif //STM_SCA

    //tx->last_k=running_transactions;
#ifdef STM_MCATS
	tx->committed_transactions++;
	if (tx->i_am_the_collector_thread==1 && ret==1) {
		stm_word_t active=running_transactions;
		tx->start_no_tx_time=STM_TIMER_READ();
		ATOMIC_FETCH_DEC_FULL(&running_transactions);

		stm_time_t useful = tx->start_no_tx_time - tx->last_start_tx_time;
		tx->total_wasted_time+=tx->last_start_tx_time-tx->first_start_tx_time;
		tx->committed_transactions_as_a_collector_thread++;
		tx->total_tx_useful_per_active_transactions[active]+=useful;
		tx->total_tx_committed_per_active_transactions[active]++;
		tx->total_useful_time+=useful;
		if(tx->committed_transactions_as_a_collector_thread==tx_per_tuning_cycle){
			if(tx->thread_identifier==max_concurrent_threads - 1) stm_tune_scheduler();
			current_collector_thread =(current_collector_thread + 1)% max_concurrent_threads;
			tx->i_am_the_collector_thread=0;
		}

	}else if(current_collector_thread==tx->thread_identifier){
		tx->start_no_tx_time=STM_TIMER_READ();
		ATOMIC_FETCH_DEC_FULL(&running_transactions);
		tx->i_am_the_collector_thread=1;
	}else ATOMIC_FETCH_DEC_FULL(&running_transactions);
	stm_tx_t *transaction=_tinystm.threads;
	int i;
	for (i=1;i< max_concurrent_threads-1;i++){
		if(transaction==NULL)
			break;
		if(transaction->i_am_waiting==1){
			transaction->i_am_waiting=0;
			break;
		}
	transaction=transaction->next;
	}
#endif


  return ret;
}
コード例 #9
0
ファイル: stm.c プロジェクト: HPDCS/stmMCATS
/*
 * Called by the CURRENT thread to commit a transaction.
 */
_CALLCONV int
stm_commit(void)
{
	TX_GET;
	int ret;
#ifdef STM_MCATS
	tx->last_k=running_transactions;
#endif
	ret=int_stm_commit(tx);
#ifdef STM_MCATS
	tx->committed_transactions++;
	if (tx->i_am_the_collector_thread==1 && ret==1) {
		stm_word_t active=running_transactions;
		tx->start_no_tx_time=STM_TIMER_READ();
		if (tx->CAS_executed) {
			ATOMIC_FETCH_DEC_FULL(&running_transactions);
			stm_tx_t *transaction=_tinystm.threads;
			int i;
			for (i=1;i< max_concurrent_threads-1;i++){
				if(transaction==NULL)
					break;
				if(transaction->i_am_waiting==1){
					transaction->i_am_waiting=0;
					break;
				}
				transaction=transaction->next;
			}
		}

		stm_time_t useful = tx->start_no_tx_time - tx->last_start_tx_time;
		tx->total_wasted_time+=tx->last_start_tx_time-tx->first_start_tx_time;
		tx->committed_transactions_as_a_collector_thread++;
		tx->total_tx_useful_per_active_transactions[active]+=useful;
		tx->total_tx_committed_per_active_transactions[active]++;
		tx->total_useful_time+=useful;
		if(tx->committed_transactions_as_a_collector_thread==transactions_per_tuning_cycle){
			if(tx->thread_identifier==max_concurrent_threads - 1) stm_tune_scheduler();
			current_collector_thread =(current_collector_thread + 1)% max_concurrent_threads;
			tx->i_am_the_collector_thread=0;
		}

	}else if(current_collector_thread==tx->thread_identifier){
		tx->start_no_tx_time=STM_TIMER_READ();
		if (tx->CAS_executed) {
			ATOMIC_FETCH_DEC_FULL(&running_transactions);
			stm_tx_t *transaction=_tinystm.threads;
			int i;
			for (i=1;i< max_concurrent_threads-1;i++){
				if(transaction==NULL)
					break;
				if(transaction->i_am_waiting==1){
					transaction->i_am_waiting=0;
					break;
				}
				transaction=transaction->next;
			}
		}

		tx->i_am_the_collector_thread=1;

	} else if (tx->CAS_executed) {
		ATOMIC_FETCH_DEC_FULL(&running_transactions);
		stm_tx_t *transaction=_tinystm.threads;
		int i;
		for (i=1;i< max_concurrent_threads-1;i++){
			if(transaction==NULL)
				break;
			if(transaction->i_am_waiting==1){
				transaction->i_am_waiting=0;
				break;
			}
			transaction=transaction->next;
		}
	}
#endif


  return ret;
}