You cannot call Linux functions from the RT threads because
the RT system ignores Linux synchronization.
In order to wake up a Linux process you need a two step procedure
pthread_kill(LinuxThread(), irq)
Linux handler:
wake_up
See the RTfifo code for an example.
On Wed, May 09, 2001 at 04:48:22PM +0200, root wrote:
> hi all
> I think I have found a bug.
> I think the problem is that "some" kommunikation between linux kernel
> and RT-linux goes wrong.
>
> I have made a test program. It does NOT work, and crashes -> turn off.
> The program is simple. It just start a thread running every 1/10000 sec.
> The thread wake up sleeping prosses up in the queue "my_queue".
>
> The program start out fine, but when i try to open another program (in
> linux user space) it crashes.
> ps. I am using RT-linux 3.0 based on kernel 2.4.1
> /*
> * this file is have only one funktion -> to test the queue structurer
> * auther : Anders Gnistrup email : [EMAIL PROTECTED]
> *----------------------------------------------------------------------*/
>
> #include <rtl.h>
> #include <rtl_sched.h>
> #include <rtl_conf.h>
> #include <rtl_core.h>
> #include <rtl_sync.h>
>
>
> wait_queue_head_t my_queue;
> pthread_t queue_ID;
> void *queue(void *);
>
> void *queue(void *t) {
> while(1) {
> pthread_wait_np();
> wake_up(&my_queue);
> }
> return 0;
> }
>
> int init_module(void) {
> pthread_attr_t attr;
> struct sched_param sched_param;
> hrtime_t period = 1000000000/11520;
>
> init_waitqueue_head(&my_queue);
>
> pthread_attr_init(&attr);
> sched_param.sched_priority = 4;
> pthread_attr_setschedparam(&attr,&sched_param);
> pthread_create(&queue_ID,&attr, queue, (void *) 0);
> pthread_make_periodic_np(queue_ID, gethrtime(), period);
> return 0;
> }
>
>
> void cleanup_module(void) {
> pthread_suspend_np(queue_ID);
> pthread_cancel(queue_ID);
> pthread_join(queue_ID, NULL);
> }
>
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
> --
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/rtlinux/
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/