From: Arun Kumar Gupta <arungupta143@gmail.com>
To: xenomai@xenomai.org
Subject: [Xenomai] Is everything inside a function(task wchi made as a RT_task) is comes under Realtime ?
Date: Fri, 02 May 2014 19:06:18 +0530 [thread overview]
Message-ID: <53639F52.2070108@gmail.com> (raw)
Hello, I am new here,
I want to know if i make a function(task) to real time,
Is everything inside that function is in realtime scheduler or not ?
For Ex.
/*#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <sys/mman.h>
#include <native/task.h>
#include <native/timer.h>
#include <rtdk.h>
*/
#include "../../include/Controller/statcom.h"
RT_TASK demo_task;
void demo(void *arg){
RT_TASK *curtask;
RT_TASK_INFO curtaskinfo;
// hello world
rt_printf("Hello World!\n");
printf("Something");
printf("Something");
printf("Something");
// inquire current task
curtask=rt_task_self();
rt_task_inquire(curtask,&curtaskinfo);
// print task name
rt_printf("Task name : %s \n", curtaskinfo.name);
}
int main(void)
{
char str[10] ;
// Perform auto-init of rt_print buffers if the task doesn't do so
rt_print_auto_init(1);
// Lock memory : avoid memory swapping for this program
mlockall(MCL_CURRENT|MCL_FUTURE);
rt_printf("start task\n");
/*
* Arguments: &task,
* name,
* stack size (0=default),
* priority,
* mode (FPU, start suspended, ...)
*/
sprintf(str,"hello");
rt_task_create(&demo_task, str, 0, 50, 0);
/*
* Arguments: &task,
* task function,
* function argument
*/
rt_task_start(&demo_task, &demo, 0);
return 0;
}
Here i am trying to print "Something" using "printf" will it's priority
will be as high as "rt_printf"
Here task "demo" is in realtime mode.
it's important to know.
next reply other threads:[~2014-05-02 13:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-02 13:36 Arun Kumar Gupta [this message]
2014-05-02 17:40 ` [Xenomai] Is everything inside a function(task wchi made as a RT_task) is comes under Realtime ? Gilles Chanteperdrix
2014-05-04 2:15 ` ARUN GUPTA
2014-05-04 17:39 ` Gilles Chanteperdrix
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53639F52.2070108@gmail.com \
--to=arungupta143@gmail.com \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.