To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 451
450  |  452
Subject: 
Re: RCX Programming Questions and Sensor Ideas
Newsgroups: 
lugnet.robotics
Date: 
Wed, 11 Nov 1998 16:09:41 GMT
Original-From: 
Paul Haas <paulh@=Spamless=hamjudo.com>
Viewed: 
3286 times
  
On Wed, 11 Nov 1998, Todd Lehman wrote:

Paul Haas writes:

Paul, Are you sure you want to sleep before decrementing r31?

I think "oops" applies in this case.  Your fix looks correct.

p.s.  I also wonder -- in avoiding harmonic task oscillation, is sleeping
Might it be sufficient instead simply to busy-count to some random value?

It doesn't have to be random, just each task needs a different delay.
This is easy, since each task has to run its own version of the code.  For
task 3 insert 3 noops, for task 6, 6 noops, etc...

The opcode for noop is 0x00.  I'm not sure if that is defined in the .nqh
file.  If not, it is easy to add (thanks Dave).


So, let's review; 1) Semaphores are possible.  2) It takes me a few tries
to write code that works.

Anyone want to write an example program that uses semaphores?  We could
put a link to that code in the FAQ or give it to Dave Baum to put in with
the other nqc examples.

--
paulh@hamjudo.com  http://www.hamjudo.com
The April 97 WebSight magazine describes me as "(presumably) normal".



Message has 1 Reply:
  Re: RCX Programming Questions and Sensor Ideas
 
(...) Does that support an arbitrary number of tasks? If there are n tasks numbered 1 to n, and task k delays for k cycles on failure, I think you still have to be careful to make sure that the number of tasks n is smaller than the loop overhead h (...) (26 years ago, 11-Nov-98, to lugnet.robotics)

Message is in Reply To:
  Re: RCX Programming Questions and Sensor Ideas
 
(...) Paul, Are you sure you want to sleep before decrementing r31? As written, r31 is always >= 1 during the sleep -- which prevents any other tasks from obtaining a lock on the resource during this sleep time. In other words, once any two tasks (...) (26 years ago, 11-Nov-98, to lugnet.robotics)

17 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 Robotics

 
Verified and Trusted Team of Hackers
1 hour ago
Custom Search

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