Re: Closing an accepting BSD socket from a different thread
On Thu, 23 May 2019 09:10:38 +0200
Stephan Gatzka <stephan.gatzka@...> wrote:
Hello Paul!For completeness of covering the topic, the sockets for poll() don't
have to be non-blocking.
but I also foundYou can pass a timeout after which poll() will "unblock".
I can't just send aYes, Unix signals aren't implemented in Zephyr, and I personally don't
see them coming anytime soon due to reasons hinted by Marc in another
mail. (But then somehow who may contribute a high-quality
implementation of them may think otherwise).
No, it's not, in a sense of "busy-wait polling". It's a well-known lowEventually, we'll need to catch and fix such cases. But the onlyWill do.
duty cycle design pattern. If you poll() with timeout of 100ms and then
wake up for 1ms, you you're sleeping 99% of time, 1% duty cycle. But 1ms
is a huge period of time, it's 100,000 cycles of a 100MHz CPU. If you
optimize that to some 1000s of cycles on event-free wakeups, you can
achieve >0.1% duty cycle.
That ISure, Zephyr needs a lot of optimizations of low-power usage, any
contribution is welcome.
No, the only possible solution I see is an additional socketThere was actually a patch submitted to Zephyr mainline which used that
technique. I dissuaded the author from following that approach, as I
consider it to be definitely too heavy-weight to seriously used in
mainline. But you definitely can use it at prototyping stage on your
The reason for my question is that I need to implement an event loopRight, so everyone wants Zephyr to be able to do advanced things, and
everyone agrees that it's too young yet and missing a lot of such
advanced functionality. My response tried to outline ways to get
started right away, albeit with some compromises here and there.
Hopefully, such a smooth start-up curve would motivate you to
contribute for resolution of the issues you write about.
An alternative is to wait until someone implements it all. As an
example, I want to implement epoll() for 2 years now. And I can't even
bootstrap a good discussion of it (at least shoot a brain-dump message
once: https://lists.zephyrproject.org/g/devel/topic/25004178) - we have
much more mundane things to do so far :-I.
Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog