Subject:
|
RE: Spawning threads in NBC
|
Newsgroups:
|
lugnet.robotics.nxt
|
Date:
|
Wed, 31 Jan 2007 02:12:14 GMT
|
Reply-To:
|
<dickswan@sbcglobal.^AvoidSpam^net>
|
Viewed:
|
13199 times
|
| |
| |
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?
|
|
Message has 2 Replies: | | Re: Spawning threads in NBC
|
| (...) 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 (...) (18 years ago, 31-Jan-07, to lugnet.robotics.nxt)
| | | Re: Spawning threads in NBC
|
| (...) Just to clarify, NXT-G doesn't have a thread scheduler. NXT-G is a just a graphical programming language, not a firmware or a virtual machine. The standard NXT firwmare implements a virtual machine which has a thread scheduler. The name of the (...) (18 years ago, 31-Jan-07, to lugnet.robotics.nxt)
|
Message is in Reply To:
| | Re: Spawning threads in NBC
|
| (...) I stop a thread the manual way: #define STOP_OTHER_THREAD() \ set bOtherThreadEnable, FALSE dseg segment bOtherThreadEnable byte TRUE ends thread main start OtherThread // John's great invention //... STOP_OTHER_THREAD() // ... endt thread (...) (18 years ago, 30-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
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in NXT programmable brick
|
|
|
|