Hello :
I have a simple thread running on my rt linux box. I have made this
thread as
pthread_attr_init (&attr);
sched_param.sched_priority = 4;
pthread_attr_setschedparam (&attr, &sched_param);
ret = pthread_create (&mem_tasks[1], &attr, thread_stimulate_code, (void *)
printk ("init_module : test2\n");
if (ret !=0)
{
rtl_printf ("failed to create the second thread \n");
return -1;
}
printk ("init_module : test3\n");
rtl_no_interrupts (flags);
if ( pthread_make_periodic_np( mem_tasks[1], gethrtime(), SPEED*300000000 )
printk ("\n MEM Thread 2 is periodic now\n");
// zonk out the thread so it can be woken up by the code
pthread_suspend_np ( mem_tasks[1]);
rtl_restore_interrupts (flags);
Now, what is does is
void *thread_stimulate_code(void *t)
//send request for read from rt_tulip
{
int i ;
struct my_msg_struct msg;
msg.command= RCV_FRM;
msg.length = sizeof (msg);
pthread_wakeup_np (mem_tasks [1]);
while (1)
{
int ret = pthread_wait_np();
// end execution until the next period
// while(test_bit(0,(void *)&rtn_change_dest_flag));
// rtf_put (CTL_PIPE, &msg, sizeof(msg));
rtl_printf ("Got the Data: stimulate code \n");
}
return 0;
}
My questions is :
Why does it bring the host to its knees ?
I thought int ret = pthread_wait_np(); would put to sleep for a while.
How can I make this task less active ?
Thank you ,
Olga
-- [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/