View Single Post
  #5   Spotlight this post!  
Unread 23-01-2015, 17:32
Greg McKaskle Greg McKaskle is online now
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Using shared variables instead of global variables

My previous post was open in my editor for quite awhile, so was largely redundant by the time I pressed the button.

Responding to your newer post, I think it will help if you can put the inputs to a state machine into a cluster. Put the outputs into a cluster as well. This will probably cut down by a factor of eight to ten.

In some code I've done that sounds similar, I also moved most of these globals into what we call a functional global. This is sometimes called a LV2 style global. It is a function with state data that has operations such as read and write, but sometimes read/and/clear, or append and remove. Anyway, these functions are often a good way to clean up scattered sets of globals into a small intelligent object that stores the data and makes access safe for a parallel language.

Greg McKaskle
Reply With Quote