View Single Post
  #4   Spotlight this post!  
Unread 02-03-2014, 19:51
heuristics heuristics is offline
Registered User
FRC #3634
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Trumbull, CT
Posts: 21
heuristics is on a distinguished road
Re: Visual C++: Getting socket server to run parallel to other processes

I've personally only worked with posix (pthread) and Java threads but it looks like this http://msdn.microsoft.com/en-us/libr...vs.110%29.aspx may be what you need for C++ .net. It sounds like you're going to want to have at least two threads, one for network communication (or maybe you need two for bidirectional communication? I haven't done much network coding) and one for your image processing. And it sounds like you've got some rending going on, too, so you might want another thread to take care of that. The tough part is finding all the critical sections where you want to make sure data isn't accessed/written to at the same time by two separate threads. Usually this can be achieved by locking a mutex and copying all the data from the members that one thread owns to the other thread's members.