Re: [dpdk-dev] [PATCH v2 1/2] eal: add API that sleeps while waiting for threads

2018-10-16 Thread Ananyev, Konstantin
> > +/* > + * Wait until a lcore finished its job by pthread condition. > + */ > +int > +rte_eal_wait_lcore_sleep(unsigned slave_id) > +{ > + if (lcore_config[slave_id].state == WAIT) > + return 0; > + > + pthread_mutex_lock(&rte_eal_thread_mutex[slave_id]); > + while (lcor

Re: [dpdk-dev] [PATCH v2 1/2] eal: add API that sleeps while waiting for threads

2018-10-16 Thread Ananyev, Konstantin
HI Ferruh, > -Original Message- > From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Ferruh Yigit > Sent: Monday, October 15, 2018 11:21 PM > To: Richardson, Bruce > Cc: dev@dpdk.org; Yigit, Ferruh ; > step...@networkplumber.org > Subject: [dpdk-dev] [PATCH v2 1

[dpdk-dev] [PATCH v2 1/2] eal: add API that sleeps while waiting for threads

2018-10-15 Thread Ferruh Yigit
It is common that sample applications call rte_eal_wait_lcore() while waiting for worker threads to be terminated. Mostly master lcore keeps waiting in this function. The waiting app for termination is not a time critical task, app can prefer a sleep version of the waiting to consume less cycles.