View Single Post
  #12   Spotlight this post!  
Unread 13-09-2014, 17:50
Dkt01's Avatar
Dkt01 Dkt01 is offline
Programming Mentor
AKA: David
FRC #1756 (Argos)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Peoria, Il
Posts: 145
Dkt01 will become famous soon enough
Re: The DevServer TCP-based data server

One possible issue I see is that you never seem to lock data during reads/writes. If you're managing (potentially) high-volume accesses of data, asynchronous reads and writes of un-locked data could lead to race conditions and/or data corruption. I haven't closely inspected your code, but it appears you are using threading for save_file_fs_async(). Consider the case where that data is being read during an asynchronous save. Implementing even a simple lock system would prevent undesired behavior.

Unrelated: some commenting of your code would go a long way. In its current state, your code makes it difficult to quickly understand what is going on. Consider commenting a description of what each function does and what its parameters are.

Good work so far!