| | Spawning threads in NBC
|
|
Thanks to David Wallace's very thought-provoking (although somewhat distracting) emails, I think I can put together a simple pseudo NBC opcode which will let you start a thread in a manner very similar to how it works in NQC. It requires a couple (...) (18 years ago, 28-Jan-07, to lugnet.robotics.nxt)
|
|
| | Re: Spawning threads in NBC
|
|
(...) A dream (soon) becoming true ;o) Philo (18 years ago, 29-Jan-07, to lugnet.robotics.nxt)
|
|
| | Re: Spawning threads in NBC
|
|
(...) Is there any plan to create a way to stopped threads that have been spawned in this way (similar to NQC)? (18 years ago, 29-Jan-07, to lugnet.robotics.nxt)
|
|
| | Re: Spawning threads in NBC
|
|
(...) Unfortunately, there really isn't any way to implement a mechanism for stopping a thread from another thread (without firmware modifications). John Hansen (18 years ago, 29-Jan-07, to lugnet.robotics.nxt)
|
|
| | RE: Spawning threads in NBC
|
|
In practicality, it is not a good practice to kill another thread without some sort of synchronization anyway. However, if one thread is not responding for a long period of time, it will be good to allow the parent thread to terminate it. (...) (18 years ago, 29-Jan-07, to lugnet.robotics.nxt)
|
|
| | Re: Spawning threads in NBC
|
|
(...) I'm trying to leave you alone John, but I haven't been too successful :). (18 years ago, 30-Jan-07, to lugnet.robotics.nxt)
|
|
| | 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)
|
|
| | 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)
|
|
| | 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)
|