[riot-devel] Condition Variables

Sam Kumar samkumar99 at gmail.com
Thu Aug 18 18:41:57 CEST 2016


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
implementation.

Sam

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

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/devel/attachments/20160818/c418c432/attachment.html>


More information about the devel mailing list