[riot-devel] Condition Variables

Simon Brummer brummer.simon at googlemail.com
Wed Aug 17 11:21:57 CEST 2016


Dear fellow TCP implementor,

The common way implement something like this in RIOT is Message
passing. Your thread simply blocks by calling msg_receive() until it
received a message from another thread. As soon as you receive a
Packet, send a message to the via msg_send() function to wake the
blocked thread. 

Cheers 
   Simon Brummer

Am Dienstag, den 16.08.2016, 12:49 -0700 schrieb Sam Kumar:
> Hello,
> I was looking at the synchronization primitives in RIOT OS. I noticed
> that there is a mutex implementation, but I was unable to find a
> condition variable.
> 
> I am currently porting the TCP logic from the FreeBSD operating
> system to RIOT as part of the research work I am doing. I am
> implementing the "conn" API for TCP, and I need to be able to block
> the current thread until a packet is received, to implement some of
> the functions.
> 
> I read the IPC implementation (msg.c), which also has a blocking API,
> and saw that it interacts with the scheduler manually in order to
> block and resume threads. Before I did the same thing for the conn
> API (or perhaps implement/contribute my own condition variable), I
> wanted to ask whether there are condition variables for RIOT, in case
> I was just looking in the wrong place. If not, I want to learn if
> there is another structured way to block a thread until an event,
> that I should use instead.
> 
> Thanks,
> Sam Kumar
> _______________________________________________
> devel mailing list
> devel at riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel


More information about the devel mailing list