All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] analog output device with comedi/analogy -- suddenly threads don't work anymore
@ 2009-10-29  0:19 Stefan Schaal
  2009-10-29  8:30 ` Gilles Chanteperdrix
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Stefan Schaal @ 2009-10-29  0:19 UTC (permalink / raw)
  To: xenomai; +Cc: Peter Pastor Sampedro

Hi,

   this is following up on an installation of Alex's Xenomai tree on  
Ubuntu 9.04 running the 2.6.29.5 kernel. While we managed to talk to  
the  NI data acquisition board we have with this tree, we suddenly  
discovered that some of our other software doesn't work anymore, in  
particular threads. Below is a tiny program to run a thread, and the  
compile statement we use. The thread never starts running. Does  
anybody know what is going wrong here?

Thanks  a lot for any hint!

Best wishes,

-Stefan

compile statement:

gcc -o xtest xeno_thread_test.c -I/Network/Servers/duerer/clmc/prog/ 
include -I/usr/xenomai/include -I/usr/xenomai/include/posix - 
D_GNU_SOURCE -D_REENTRANT -Wall -pipe -D__XENO__ -Wl,@/usr/xenomai/lib/ 
posix.wrappers -L/usr/xenomai/lib -lpthread_rt -lpthread -lrt


run the executable:

unix> xtest (which should generate some print-outs, but it doesn't ...)


//------------------------------------------------- start of file  
-----------------------------------------------------------------------
#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;
}
// ----------------------------------- end of file  
------------------------------------------------------------


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

end of thread, other threads:[~2009-12-22  7:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-29  0:19 [Xenomai-help] analog output device with comedi/analogy -- suddenly threads don't work anymore Stefan Schaal
2009-10-29  8:30 ` Gilles Chanteperdrix
2009-10-29  8:52 ` Gilles Chanteperdrix
2009-10-29 14:08 ` Gilles Chanteperdrix
2009-10-29 15:25   ` Stefan Schaal
     [not found]     ` <FF6D4747-95BE-4B18-8B77-864B7DA5EAEF@usc.edu>
     [not found]       ` <4AE9E5AC.7050401@domain.hid>
2009-12-18 21:10         ` [Xenomai-core] digital I/O with analgoy using ni_pcmcia Stefan Schaal
2009-12-21 23:23           ` Alexis Berlemont
2009-12-22  7:02             ` Stefan Schaal

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.