View Single Post
  #43   Spotlight this post!  
Unread 10-03-2014, 17:32
JamesTerm's Avatar
JamesTerm JamesTerm is offline
Terminator
AKA: James Killian
FRC #3481 (Bronc Botz)
Team Role: Engineer
 
Join Date: May 2011
Rookie Year: 2010
Location: San Antonio, Texas
Posts: 298
JamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to behold
Re: Serious bug identified in SmartDashboard/NetworkTables -- robot hangs

Quote:
Originally Posted by NotInControl View Post
Based on what I read it appears the crux of the problem is that although NT is multithreaded, it holds on to a lock during a write sequence. A write sequence which also blocks and keeps the lock if the write fails. The robot thread uses this same lock to push data, thus causing the hang on the robot. Is this all correct?
Kevin
Yes


Quote:
Originally Posted by NotInControl View Post
My question is the code to obtain the lock on the robotside in NT or in SmartDash? If you were to call the smartDashboard putXXX methods in a separate thread, would that not at least prevent the hang?

I have not spent any time looking into the NT/SD implemenation, yet, but I will.
The fix is similar to this idea... because the lock used in the call to Put() spans just the read and writes of the mapped variable and ID. The other work it does is non-blocked. The same is true for using the Get() methods too. SmartDashboard Get and Put calls (at least for c++ code) are just an interface/wrapper to the Network Tables. I have not looked at the Java port, but since this was developed from a Java perspective... I'll bet it is nearly the same as the c++ port.
Reply With Quote