library/src/threads/BP-LinuxThreads.cc
// This routine will submit the provided arguments
// to the threads currently in the thread manager, processing
// data in each thread sequentially.  Ideally, the processed data
// should be an opaque type capable of storing the result of the
// processing within itself (struct->ret_value).
This routine will submit the provided arguments
to the threads currently in the thread manager, processing
data in each thread sequentially.  Ideally, the processed data
should be an opaque type capable of storing the result of the
processing within itself (struct->ret_value).
This routine will submit the provided arguments to the threads currently in the thread manager processing data in each thread sequentially . Ideally the processed data should be an opaque type capable of storing the result of the processing within itself ( struct - > ret_value ) .
BP_ERROR_T BP_ThreadedDataProcessor
(
	P_BP_THREAD_MANAGER thread_manager,
	void **   args,     
	size_t *  arg_lens, 
	size_t    arg_n     
)
{
	if(!thread_manager)
		return ERR_FAILURE;
	size_t n = 0;
	for
	(
		n = 0;
		n < arg_n;
		n++
	)
	{
		BP_RedispatchThread
		(
			thread_manager,
			args[n],
			arg_lens[n],
			n
		);
	}
	BP_RejoinAllThreads(thread_manager);
	return ERR_SUCCESS;
}
BP_ERROR_T BP_ThreadedDataProcessor ( P_BP_THREAD_MANAGER thread_manager , void * * args , size_t * arg_lens , size_t arg_n ) { if ( ! thread_manager ) return ERR_FAILURE ; size_t n = 0 ; for ( n = 0 ; n < arg_n ; n ++ ) { BP_RedispatchThread ( thread_manager , args [ n ] , arg_lens [ n ] , n ) ; } BP_RejoinAllThreads ( thread_manager ) ; return ERR_SUCCESS ; }
This routine will submit the provided arguments
to the threads currently in the thread manager, processing
data in each thread sequentially.
This routine will submit the provided arguments to the threads currently in the thread manager processing data in each thread sequentially .
/* argument stack */ /* array of argument lengths */ /* number of arguments total */ // ensure we have a threaded manager // redispatch all items in the argument stack // DONT WRAP IN CRITICAL SECTION // attempt to redispatch the threads // DON"T WRAP IN CRITICAL SECTION: attempt to rejoin all the threads // return indicating success