All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] bring down the system
@ 2009-11-04  1:18 Stefan Schaal
  2009-11-04  6:35 ` Stefan Schaal
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Schaal @ 2009-11-04  1:18 UTC (permalink / raw)
  To: xenomai; +Cc: Peter Pastor

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 <pthread.h>
#include <stdio.h>

pthread_t cthread;

// a quick thread to run ....
void *
run_thread(void *dummy)
{
   int i;

   for (i=1; i<=1000; ++i) {
     printf("%d thread is runnning\n",i);
     sleep(1);
   }
   return NULL;
}

// main program
int
main() {

   int rc;
   pthread_attr_t pth_attr;

#ifdef __XENO__
   mlockall(MCL_CURRENT | MCL_FUTURE);
#endif

   if ((rc=pthread_attr_init(&pth_attr)))
       printf("pthread_attr_init returned %d\n",rc);

   if ((rc=pthread_create( &cthread, &pth_attr, run_thread, NULL)))
       printf("pthread_create returned with %d\n",rc);

   // wait a bit to get some print outs from the thread
   sleep(10);

   return 1;
}



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-11-04 10:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-04  1:18 [Xenomai-help] bring down the system Stefan Schaal
2009-11-04  6:35 ` Stefan Schaal
2009-11-04  6:52   ` Wolfgang Denk
2009-11-04  7:11     ` Stefan Schaal
2009-11-04  7:21     ` Jonas Buchli
2009-11-04  7:26       ` Wolfgang Denk
2009-11-04  7:37         ` Jonas Buchli
2009-11-04 10:50   ` Gilles Chanteperdrix

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.