Go to Post I think candids are my best... I'm sneaky with my 12X optical zoom. - MissInformation [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-03-2014, 21:09
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Not Enough Threads :D

I love low lag times and high frame rates. I realised that I was getting 30fps running everything on a single thread on a sad windows 8.1 installation, i3 @ 1.4GHz. 30fps...That's not enough! I dared myself to thread the application and now we will see the outcome of that idea [Evil...Activate].
Ok...Enough of the hyper-Dev,
So I have created a threading model and I would like to get some input from our experts, like fause1706, techelpdd and some other geniuses, just to name a few

Here's a link, and feel free to report problems, spring me a couple ideas or anything!

Oh yeah, and I forgot to mention, Have Fun at your competitions and play safe
  #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.
  #3   Spotlight this post!  
Unread 13-03-2014, 15:31
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: Not Enough Threads :D

However, I am wondering if it will overload the system if I have a core for each processing system and a run the terminal server and the three udp servers in the main thread, idling most of the time. Will if swamp my system to the point that it is inoperable?

How can I assign physical cores to threads? I know the hardware so I really don't need to write code to mess with finding the core count!

I want to assign the last two cores to the processing loops, the 1st to the aqcuisition and the 0th to the servers!
  #4   Spotlight this post!  
Unread 13-03-2014, 16:07
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Not Enough Threads :D

I don't know Windoze internals but what you are talking about is "affinity" - assigning threads to executing units. Look for a Windoze API call to to set the affinity.
__________________
Fast, cheap or working - pick any two!
  #5   Spotlight this post!  
Unread 15-03-2014, 11:25
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: Not Enough Threads :D

I am programming in Linux, and I like your spelling .

I will take a look at affinity. I am just a student with no good C mentors (but I have awesome Java ones), so I don't really have knowledge of the internals of a computer or the terminology of these processes! Thanks
  #6   Spotlight this post!  
Unread 15-03-2014, 22:40
AlexBrinister AlexBrinister is offline
Registered User
AKA: Alex Brinister
FRC #1768 (RoboChiefs)
Team Role: Alumni
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Bolton, MA
Posts: 93
AlexBrinister will become famous soon enough
Re: Not Enough Threads :D

Linux man page on the C thread affinity interface

POSIX Thread Affinity interface man page

Some useful pages on thread affinity:
Here
Here
and...
Here

Hope this helps!

Alex Brinister
  #7   Spotlight this post!  
Unread 15-03-2014, 23:34
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: Not Enough Threads :D

I need to take a look at those during my free time! Right now, I need to get a working program down!
  #8   Spotlight this post!  
Unread 16-03-2014, 11:52
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: Not Enough Threads :D

I just noticed how I spelled faust1706 and techhelpbb wrong! Sorry
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 04:50.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi