Skip to content

Latest commit

 

History

History

task-03

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

previous task

Task 3: Multithreading

Threads in RIOT are functions with signature

void *thread_handler(void *arg);

Use thread_create() from thread.h to start it

thread_create(stack, sizeof(stack),
                    THREAD_PRIORITY_MAIN - 1,
                    THREAD_CREATE_STACKTEST,
                    thread_handler,
                    NULL, "thread");

thread_create returns a kernel_pid_t type, which can be helpful to assign to a variable (but not necessary for this lesson).

Task 3.1: Start a thread

  • Start the thread "thread" from within main()
  • Run the application on native: make all term
  • Check your output, it should read: I'm in "thread" now

Read the doc

next task