[riot-users] Simple thread

Christian Mehlis christian at m3hlis.de
Tue Oct 21 14:15:04 CEST 2014


Am 21.10.2014 um 13:51 schrieb Marcio Segura:
> while (1){}

You can't do this in RIOT. The thread with the highest priority is 
always running, so the other thread will not start...

btw. this chunk of code is bad on linux too, because it will simply burn 
your cpu...

better use thread_{sleep,wait} or pthread_join.

you can take a look at the pthread tests in the test folder.
for a simple test with such a simple logic I would not use the pthread 
abstraction...you can just use riot threads (core/threads).

Good luck,
Christian



More information about the users mailing list