Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7666045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:44:06+00:00 2026-05-31T14:44:06+00:00

I wrote a hello world program with an infinite loop with Xenomai API, as

  • 0

I wrote a hello world program with an infinite loop with Xenomai API, as follows:
This gets terminated soon.

I actually wanted to test this program’s real time latency through latencytop.
How to run an infinite loop in real time?

RT_TASK demo_task;

void demo(void *arg)
{
    RT_TASK *curtask;
    RT_TASK_INFO curtaskinfo;

    curtask=rt_task_self();
    rt_task_inquire(curtask,&curtaskinfo);

    printf("Task name : %s \n", curtaskinfo.name);

        //------------------ hello world --------------------
    while (1)
    {
        printf("Hello World!\n");
    }

}

int main(int argc, char* argv[])
{
    char  str[10];

    rt_print_auto_init(1);

    mlockall(MCL_CURRENT|MCL_FUTURE);

    printf("start task\n");

    sprintf(str,"hello");
    rt_task_create(&demo_task, str, 0, 50, 0);

    rt_task_start(&demo_task, &demo, 0);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T14:44:08+00:00Added an answer on May 31, 2026 at 2:44 pm

    At the bottom of main, also put an infinite loop. while(1) sleep(10000) is usually good on full-blown linux, don’t know about RT-world.

    What’s happening is that you’re spawning off a new task and then main is immediately returning after this, which exits the entire process.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just learning scala, and I wrote the hello,world program like this: object HelloWorld
I wrote this small C++ program and built it(Release) #include<iostream> int main(){ std::cout<<Hello World;
I wrote a simple hello world program to test the JDK installation. I can
Problem: I wrote a hello world java program, compiled and created a jar file
I set up CDT for eclipse and wrote a simple hello world C program:
I am new to PHP, just downloaded it, and wrote a Hello, World! program:
I wrote a simple c++ program that prints Hello World! #include <iostream> using namespace
This is my first C program. hello world! I'm sure this is no problem
I just started learning C, and wrote my hello world program: #include <stdio.h> main()
I just started learning C, and wrote my hello world program: #include <stdio.h> main()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.