src/mydp/threadwq/threadwq_man_rr.c
static int rr_add_job(struct threadwq_man *man, struct threadwq_job *job)
{
	{
		unsigned int idx = uatomic_read(&man->rr.twq_idx);

		if (idx >= man->twq_pool_nr)
		{
			idx = 0;
			uatomic_set(&man->rr.twq_idx, 0);
		}
		else
		{
			uatomic_inc(&man->rr.twq_idx);
		}

		{
			struct threadwq *twq = &man->twq_pool[idx];
			threadwq_add_job(twq, job);
		}
	}

	return 0;
}
/*
 * Round-robin (RR): Add job into twq one by one.
 *
 * Assume the job is w/ similar cost. Then round-robin is usually good. Consider others if cache-hit is critical.
 */
Round-robin (RR): Add job into twq one by one.
Assume the job is w/ similar cost. Then round-robin is usually good. Consider others if cache-hit is critical.
Round - robin ( RR ) : Add job into twq one by one . Assume the job is w / similar cost . Then round - robin is usually good . Consider others if cache - hit is critical .
static int rr_add_job(struct threadwq_man *man, struct threadwq_job *job)
{
	{
		unsigned int idx = uatomic_read(&man->rr.twq_idx);
		if (idx >= man->twq_pool_nr)
		{
			idx = 0;
			uatomic_set(&man->rr.twq_idx, 0);
		}
		else
		{
			uatomic_inc(&man->rr.twq_idx);
		}
		{
			struct threadwq *twq = &man->twq_pool[idx];
			threadwq_add_job(twq, job);
		}
	}
	return 0;
}
static int rr_add_job ( struct threadwq_man * man , struct threadwq_job * job ) { { unsigned int idx = uatomic_read ( & man -> rr . twq_idx ) ; if ( idx >= man -> twq_pool_nr ) { idx = 0 ; uatomic_set ( & man -> rr . twq_idx , 0 ) ; } else { uatomic_inc ( & man -> rr . twq_idx ) ; } { struct threadwq * twq = & man -> twq_pool [ idx ] ; threadwq_add_job ( twq , job ) ; } } return 0 ; }
Round-robin (RR): Add job into twq one by one.
Round - robin ( RR ) : Add job into twq one by one .