Sorry, I attached the wrong C-program in the previous posting ....  
here is the corrected version:

Hi,

  attached is a little C program that spawns off a task which runs a  
heavy tiny math job. Despite my 8 processor machine, taking this one  
task to 99% CPU load slows down the entire computer, often such that  
there is no return except for a forced restart.

I run the xenomai-head git, updated on Oct. 29 the last time, on a  
i386 ubuntu system with kernel 2.6.29.5.

Does anybody know what is going wrong here, i.e., am I not permitted  
to take my CPUs to the max load?

Any help would be highly appreciated!!!

Best wishes,

-Stefan



Compile statement:

gcc -o xtest xeno_spawn_test.c -I/usr/xenomai/include -Wl,@/usr/ 
xenomai/lib/posix.wrappers -L/usr/xenomai/lib -lpthre
ad_rt -lpthread -lrt  -lnative

Run:

unix> xtest



------------------------------------------------  xeno_spawn_test.c  
---------------------------------------------
#include <sys/mman.h>
#include <native/task.h>
#include <pthread.h>
#include <stdio.h>
#include <math.h>

RT_TASK task;

// a quick task run ....
void
run_task(void *dummy)
{
   int i;
   double foo = 1.0;

   for (i=1; i<=100000000; ++i)
     foo = foo*1.1;

   return;
}

// main program
int
main() {

   int rc;
   pthread_attr_t pth_attr;

   mlockall(MCL_CURRENT | MCL_FUTURE);

   // spawn the task
   if ((rc=rt_task_spawn(&task,"run_task",100000,1,T_JOINABLE|T_FPU| 
T_CPU(1),run_task,NULL)))
       printf("rt_task_spawn returned %d\n",rc);

   rt_task_join(&task);

   return 1;
}





_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to