Go to Post Pessimism and optimism are both contagious. - Taylor [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 17-01-2009, 13:57
Joohoo's Avatar
Joohoo Joohoo is offline
Registered User
FRC #0340 (G.R.R.)
Team Role: Mentor
 
Join Date: Jun 2005
Rookie Year: 2005
Location: Rochester
Posts: 241
Joohoo is just really niceJoohoo is just really niceJoohoo is just really niceJoohoo is just really niceJoohoo is just really nice
Send a message via AIM to Joohoo Send a message via Yahoo to Joohoo
c++ multi threaded program?

I was perusing through the standard include files and I found one of my old friends the pthread.h file. Now I know that vxworks is POSIX compliant. But does any one know if it is possible to create a multi threaded program to run on the crio? Has anyone else noticed this? Is any one looking to use this functionality to their advantage?
  #2   Spotlight this post!  
Unread 17-01-2009, 14:23
gvarndell's Avatar
gvarndell gvarndell is offline
Software Engineer
AKA: Addi's and Georgie's Dad
FRC #1629 (GaCo)
Team Role: Parent
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Grantsville, Maryland
Posts: 350
gvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond repute
Re: c++ multi threaded program?

Quote:
Originally Posted by Joohoo View Post
I was perusing through the standard include files and I found one of my old friends the pthread.h file. Now I know that vxworks is POSIX compliant. But does any one know if it is possible to create a multi threaded program to run on the crio? Has anyone else noticed this? Is any one looking to use this functionality to their advantage?
vxWorks 6.3 is fairly POSIX compliant, and does support pthreads.
Whether or not can use them depends on how the kernel was configured.
Since the configuration of the kernel we're stuck with is largely unknown and must be guessed at, I can't say.
Beware looking for symbols that might indicate this or that is configured into the kernel though.
Object files are sometimes linked in the kernel even if the kernel features that module supports are not configured.
So, using nm or some such, you might find that pthread_create is 'in' the kernel yet it won't work right because the kernel is not properly configured.
I do wish the good folks at WPI would give us a way to know the kernel configuration -- even better, give us the BSP so we can build our own kernels.
  #3   Spotlight this post!  
Unread 17-01-2009, 14:38
aaeamdar's Avatar
aaeamdar aaeamdar is offline
Post-A-Holic
AKA: Paul Dennis
FRC #1719 (The Umbrella Corp)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Baltimore, MD
Posts: 231
aaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant future
Re: c++ multi threaded program?

I'm not sure why you would ever want to be using multiple threads for this type of project - there's just no need for them (that I can think of). Threads are for when you need to be doing multiple things concurrently - what two things (or more) would you need to be doing concurrently in this robotics application? An easy example of thread use in other applications is when you want to add music to your videogame that you just wrote. The two things you want to be doing concurrently are:

1. Keeping up with the game (resolving collisions of spaceships with lasers, etc)
2. Loading and playing the next byte of sound data.

So, no, can't really see how anyone would use threads to do anything other than confuse themselves - but interested to hear others' ideas.

-Paul
  #4   Spotlight this post!  
Unread 17-01-2009, 15:04
gvarndell's Avatar
gvarndell gvarndell is offline
Software Engineer
AKA: Addi's and Georgie's Dad
FRC #1629 (GaCo)
Team Role: Parent
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Grantsville, Maryland
Posts: 350
gvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond repute
Re: c++ multi threaded program?

Quote:
Originally Posted by aaeamdar View Post
I'm not sure why you would ever want to be using multiple threads for this type of project - there's just no need for them
Every Labview and C++ programmer in this year's game will be be doing whatever they do thanks to the benefits of multi-tasking (same as threading).
Most won't even know it -- some will and will exploit it to good advantage.
Even if we can't do POSIX threads, we can do multiple tasks.
Students who care about software should definitely understand concurrency.
  #5   Spotlight this post!  
Unread 17-01-2009, 17:13
Shinigami2057 Shinigami2057 is offline
Slackware Is Your New God (Mentor)
AKA: Harry Bock
FRC #1350 (Rambots)
Team Role: Programmer
 
Join Date: Oct 2006
Rookie Year: 2006
Location: Johnston, RI
Posts: 106
Shinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really nice
Re: c++ multi threaded program?

Concurrency is very useful for vision processing in this competition. We are using a completely separate thread for finding our targets, with great success. We will post our code when we've gotten more of the functionality down.
__________________
One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs.
  #6   Spotlight this post!  
Unread 18-01-2009, 10:54
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,753
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: c++ multi threaded program?

I'm pretty sure that LV internally is using posix threads for its execution. And as stated, every time a loop is drawn in parallel, it will execute that way because of the thread support of vxworks. I know that WPI has something called a task for spawning independent operations. Not sure what it is built upon, but it will hopefully be all you need for most tasks.

Greg McKaskle
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Threaded View. Madison CD Forum Support 3 28-12-2003 10:48
threaded rod Mercutio OCCRA 3 28-09-2003 20:45
threaded rod fasteners... archiver 2001 1 24-06-2002 00:08
THREADED ARCHIVE ONLINE archiver 1999 0 23-06-2002 23:09
threaded rod? RobDeCotiis Kit & Additional Hardware 4 18-02-2002 12:21


All times are GMT -5. The time now is 21:52.

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