[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-rt
Subject: Re: [rtl] Task brings the host down
From: yodaiken () fsmlabs ! com
Date: 2000-08-27 10:15:55
[Download RAW message or body]
What is the definition of "SPEED"
On Fri, Aug 25, 2000 at 08:20:54PM -0700, OMILL@ewu.edu wrote:
> 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 majordomo@rtlinux.org OR
> echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.org
> ---
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/rtlinux/
--
---------------------------------------------------------
Victor Yodaiken
Finite State Machine Labs: The RTLinux Company.
www.fsmlabs.com www.rtlinux.com
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail majordomo@rtlinux.org OR
echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.org
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic