To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.nxtOpen lugnet.robotics.nxt in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / NXT / 448
447  |  449
Subject: 
Re: Spawning threads in NBC
Newsgroups: 
lugnet.robotics.nxt
Date: 
Wed, 31 Jan 2007 12:36:00 GMT
Viewed: 
13168 times
  
In lugnet.robotics.nxt, <dickswan@sbcglobal.net> wrote:

I don't know how the NXT-G thread/task scheduler works.

Just wondering if anyone has any idea on the impact on execution
performance when multiple threads are running? And how often threads are
scheduled?

For example, if you have a "main" thread running and spawn a secondary
thread, is the CPU time divided equally between the two threads?

Currently you can't put a thread to "sleep" when you're waiting for a
timed interval to expire. The low-level code simply loops checking to
see if interval has expired. Does the firmware detect this situation and
quickly swap the waiting thread out of execution or does the thread
consume a "full" timeslice?

I'm sure someone with some firmware knowledge will have a better answer for
this, but my belief is that there are no smarts in the firmware for swapping
threads during a wait - i.e. I bet it uses a full timeslice.

I have done some BT logging from two threads in which I sent the same amount of
information from each and I saw them get equal time (i.e. one would print a line
and then the other would, etc.). However, I don't know how big the timeslices
are.

I would like to see a thread priority scheme and a real "sleep" which will swap
threads immediately. Of course, it's just a toy :).

David



Message is in Reply To:
  RE: Spawning threads in NBC
 
I don't know how the NXT-G thread/task scheduler works. Just wondering if anyone has any idea on the impact on execution performance when multiple threads are running? And how often threads are scheduled? For example, if you have a "main" thread (...) (18 years ago, 31-Jan-07, to lugnet.robotics.nxt)

10 Messages in This Thread:





Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    
Active threads in NXT programmable brick

 
Verified and Trusted Team of Hackers
19 hours ago
Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR