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 / 446
445  |  447
Subject: 
Re: Spawning threads in NBC
Newsgroups: 
lugnet.robotics.nxt
Date: 
Tue, 30 Jan 2007 23:17:48 GMT
Viewed: 
12699 times
  
In lugnet.robotics.nxt, Tim Byrne wrote:
Is there any plan to create a way to stopped threads that have been spawned in
this way (similar to NQC)?

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 OtherThread
  // initialization
Forever:
  brtst EQ, OtherThreadExit, bOtherThreadEnable
  // do stuff
  jmp Forever

OtherThreadExit:
endt

Of course, this doesn't abort it immediately, but it cleanly exits and you
probably pass through the loop fairly quickly for most applications.

David



Message has 1 Reply:
  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)

Message is in Reply To:
  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)

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
    

Custom Search

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