'How do i create a posix non real time task?

I want to create two posix thread. One of them should be a Real time task with some specified priority and the other one should be a "posix non-rt task.

To create the posix-rt-task with priority I use

#include <pthread.h>


#include <sched.h>

pthread_attr_t tattr;

pthread_t tid;

int ret;

int newprio = 20;

sched_param param;

ret = pthread_attr_init (&tattr);

ret = pthread_attr_getschedparam (&tattr, &param);

param.sched_priority = newprio;

ret = pthread_attr_setschedparam (&tattr, &param);

ret = pthread_create (&tid, &tattr, func, arg);

However, who do I specifiy a posix task with no priority? I.O.W a non RT task!? I've read on the internet and found something about shed_other. In case it is the supposed one to use, how do I type it? What is the code flow? Thanks in advance!

Interaction between posix RT-task and another posix non-RT-task




Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source