[riot-devel] Condition Variables

Simon Brummer brummer.simon at googlemail.com
Thu Aug 18 19:26:17 CEST 2016

Hi Sam,

The hole message passing avoidance is actually a pretty good point. I
prefer message passing because I can handle the hole User Function call
Timeout Handling with it as well. It would be interesting if a condition
change could occur based on the expiration of a Timer.

Just my thoughts on that.

Cheers Simon

Am 18.08.2016 6:42 nachm. schrieb "Sam Kumar" <samkumar99 at gmail.com>:

Thanks for the advice, Simon, Martin, and Kaspar!

For now, I'll use a mutex together with thread_flags. Using message
passing, as Simon suggested, would work for me as well; the reason I find
thread_flags preferable is that I need to block application threads that
call send() and receive(), that may already be using message passing.

If people don't mind, and they think it would be useful, I'm also willing
to contribute a lightweight condition variable to the core module. I think
it could be implemented simply as a queue, just like the current mutex


On Wed, Aug 17, 2016 at 10:19 AM, Kaspar Schleiser <kaspar at schleiser.de>

> Hey,
> On 08/16/2016 09:49 PM, Sam Kumar wrote:
> > If not, I want to learn if there is another structured way to
> > block a thread until an event, that I should use instead.
> maybe thread_flags work for your use-case.
> Kaspar
> _______________________________________________
> devel mailing list
> devel at riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel

devel mailing list
devel at riot-os.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/devel/attachments/20160818/5f918010/attachment.html>

More information about the devel mailing list