On Mon, Mar 20, 2000 at 06:34:11AM -0800, Jason Miller wrote:
> Hello,
> 
> Thanks guys for the good responses. I have the thread
> running on v2.2 successfully now. 
> 
> However, my new (probably simpler) question is this
> (this one may be easier to answer than the last):
> 
> If I provide a period that is too small, what should
> happen?? 
> 
> In my code I ran the thread one thousand times (that
> is after the 1000th iteration I suspend the thread)
> with a period of 1ms. Everythings good. However, when
> I decrease the period to .1ms I can only run the code
> with about 300 iterations. Anymore than 300 or so, and
> the kernel dies and I have to reboot.

That's 100 microseconds. My guess is that ee_driver_tx
calls malloc when it runs out of memory and that at this rate
you run out of memory fast.
Do you think worst case timing of the entire loop is less than 100us?

BTW: you might want to try to new gdb support.


> 
> I have supplied some code:
> 
> Thread code:
> static void *sendUIPThread(void *t)
> {
>   struct uipBuff pkt;
>   int dstNode;
>   int count = 0;
>   dstNode = (int ) t;
>   while(count < totalIterations) {
>       pthread_wait_np();
>       pkt.srcNode = myNodeID;
>       pkt.dstNode = dstNode;
>       pkt.pkt_type = 0; // control pkt for now
>       pkt.len = sizeof(pkt) + 16; //SIZEOF_UIP_BUFF +
> 16;
>       pkt.seq = count;
>       pkt.command = MSG_TEST_RND_TIME;
>       txTime[count]  = gethrtime();
>       eeDriver_tx(&pkt,
> (void*)&macTable[pkt.dstNode]);
>       count++;
>  }
>  if(count >= totalIterations)
>     pthread_suspend_np(pthread_self());
>  pthread_delete_np(sendTask);
>  return 0;
> }
> initialization of thread:
> 
>     pthread_attr_init(&attr);
>     sched_param.sched_priority = 100000;
>     pthread_attr_setschedparam(&attr, &sched_param);
>     pthread_attr_setstacksize(&attr, 5120); 
>     pthread_create(&sendTask, &attr, sendUIPThread,
> (void *)sc.dstNode);
>     pthread_wakeup_np(sendTask);
>     pthread_make_periodic_np(sendTask, gethrtime(),
> 1000000);
> 
> 
> Jason
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Talk to your friends online with Yahoo! Messenger.
> http://im.yahoo.com
> -- [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/

-- 
---------------------------------------------------------
Victor Yodaiken 
FSMLabs:  www.fsmlabs.com  www.rtlinux.com
FSMLabs is a servicemark and a service of 
VJY Associates L.L.C, New Mexico.

-- [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/

Reply via email to