View Single Post
  #2   Spotlight this post!  
Unread 13-03-2014, 11:49
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Re: Not Enough Threads :D

Most mobile i3's only have two physical CPU cores, but with hyperthreading you get 4 logical cores, which is what you see in Task Manager's performance tab. (it's also worth noting that I've observed that the CPU utilization reported by task manager reports logical threads oddly; when 2 logical threads equally use 50% of a single physical core, they each report 50% utilization, however total utilization will report 50% rather than 100%)

So in a sense, having 2 threads will yield similar performance to 4, so the split between ball and target tracking may not yield a huge improvement (however it's also probably easy, so it doesn't hurt)

Overall, your model seems fine, you'll want to be careful how you manage the life cycle of each raw image, since it is created by the acquisition thread, and consumed by the two tracking threads, where it should be shared read-only access until somebody disposes it.

If the image life-cycle becomes too complex, you should consider creating a manager thread who manages the consumption of the raw image, and feeds the ball and target tracking threads at a rate they can handle.