|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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
|
||||
|
||||
|
Re: c++ multi threaded program?
Quote:
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
|
||||
|
||||
|
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
|
||||
|
||||
|
Re: c++ multi threaded program?
Quote:
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
|
|||
|
|||
|
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. |
|
#6
|
|||
|
|||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |