> From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Dmitry Kozlyuk
> Sent: Wednesday, April 7, 2021 1:30 AM
> 
> 2021-04-06 16:34 (UTC+0200), Morten Brørup:
> > > From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Dmitry Kozlyuk
> > > Sent: Sunday, April 4, 2021 1:41 AM
> > >
> > > POSIX sleep(3) is missing from Windows.
> > > Add generic rte_thread_sleep() to suspend current OS thread.
> > >
> > > Signed-off-by: Dmitry Kozlyuk <dmitry.kozl...@gmail.com>
> > > Acked-by: Khoa To <k...@microsoft.com>
> > > Acked-by: Ray Kinsella <m...@ashroe.eu>
> >
> > How is this better than the rte_delay_us_sleep() function in
> rte_cycles.
> 
> Honestly, I just assumed the sleep() shim existed for a reason.
> Now that you pointed to it, I think indeed no new API is needed.
> 
> I wonder why rte_delay_us_sleep() is not used throughout DPDK.

I think it's just tradition from Linux/BSD developers not being used to 
cross-platform development or having forgotten how to develop software for 
deeply embedded systems without a standard O/S below. We use POSIX functions 
like sleep() without thinking about it, and simply forget looking for an EAL 
variant of the function first.

> Should their usages be converted as soon as code is enabled for
> Windows?

Yes. The Environment Abstraction Layer is there to avoid using O/S specific 
function calls. So it should be safe to replace all these sleep() calls with 
the EAL variant at any time.

Reply via email to