To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 182
181  |  183
Subject: 
Re: NQC 2.0 and some math questions
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Sat, 2 Oct 1999 16:12:55 GMT
Viewed: 
2597 times
  
In article <FIyps4.A2F@lugnet.com>, "Robert Munafo" <munafo@gcctech.com> wrote:

The official solution to the problem is to use a test-and-set primitive, but
the "practical workaround" I was taught was to insert a random delay somewhere
in the loop. You can also effectively solve the problem by having each task
delay a different, fixed amount of time. I'll show that method here.


You're right - I forgot the delay (that's what I get for typing code from
memory).

Yeah, 'test and set' is the best solution, but unfortunately the RCX
doesn't have one.  The bitflag stuff is a little ugly for my tastes, which
is why NQC does not allocate temp variables across tasks.

Dave

--
reply to: dbaum at enteract dot com



Message is in Reply To:
  Re: NQC 2.0 and some math questions
 
Your proposed solution is susceptible to the "lockstep starvation" problem. Lockstep starvation happens when two tasks try to get the lock at the same time and execute the same code in lock step, like so: task 1: lock |= 2; task 2: lock |= 4; task (...) (25 years ago, 2-Oct-99, to lugnet.robotics.rcx.nqc)

16 Messages in This Thread:




Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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