To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 1637
1636  |  1638
Subject: 
Re: pass by refrence or value?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Thu, 18 Jan 2001 07:26:20 GMT
Viewed: 
1236 times
  
Did you care to declare your global variable as volatile? this (normaly)
prevent the compiler to optimize memory access and force it to read the actual
value of the variable each time it need it ( instead of localy storing it in a
register wich will not be refresh after a first read) . This may be what happen
in you code.

michael.



Message has 1 Reply:
  Re: pass by refrence or value?
 
Some basic facts about C semantics: As already stated, globals MUST be volatile if they are accessed by more than one thread, otherwise reads and writes can be out of sync. What are the types of the variables involved? Scalar values like integers (...) (23 years ago, 25-Mar-01, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  pass by refrence or value?
 
Hi all, i have a slight problem with legosv0.2.5 . The program code on the rcx is set up so that there is serverall callback methods which get called when a message comes in on the particular port for that object or class. These callback methods set (...) (24 years ago, 18-Jan-01, to lugnet.robotics.rcx.legos)

3 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