Go to Post Not all creativity is visible or mechanical! - dtengineering [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 22-01-2009, 21:56
bomber7 bomber7 is offline
Humanoid
FRC #0585
Team Role: Programmer
 
Join Date: Feb 2007
Rookie Year: 2007
Location: CA - Tehachapi
Posts: 20
bomber7 is an unknown quantity at this point
Question Multiple threads

I am using Windriver Vxworks, C++.

In the previous controller if I wanted something to happen periodically independent of the rest of the code I could use interupts.

This year as far as I can tell interupts are no longer usable. Instead, it seems that a better solution would be available. If I could start a second independent thread I could use an infinite loop with a Sleep() in it to achieve the same effect. However, it seems the normal C++ method of starting another thread does not work.

It is my understanding that normally you can use "_Fork <functionname>" (without <>) to start a function on another thread. The compiler says that _Fork is undefined, so I'm wondering if anyone has a different solution?
Reply With Quote
  #2   Spotlight this post!  
Unread 22-01-2009, 22:07
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 323
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Multiple threads

There has been some discussion on the use of threads/tasks using WPI's wrapper, here are a couple of threads that deal with it.

http://www.chiefdelphi.com/forums/sh...ad.php?t=72371

http://www.chiefdelphi.com/forums/sh...ad.php?t=72607

http://www.chiefdelphi.com/forums/sh...ad.php?t=72439

Although you may still be able to use interrupts. Look into Encoder.h and Encoder.cpp
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
Reply With Quote
  #3   Spotlight this post!  
Unread 22-01-2009, 22:39
bomber7 bomber7 is offline
Humanoid
FRC #0585
Team Role: Programmer
 
Join Date: Feb 2007
Rookie Year: 2007
Location: CA - Tehachapi
Posts: 20
bomber7 is an unknown quantity at this point
Re: Multiple threads

Awesome, thanks, I got what I needed from those threads, for some reason my search didn't turn up any of those threads.

Thank you for the help.
Reply With Quote
Reply


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
[FTC]: Multiple Programs or One Program with Multiple Auto Modes kevin51292 FIRST Tech Challenge 4 02-01-2009 20:37
Hosting multiple sites in multiple VMs EHaskins Website Design/Showcase 6 22-12-2007 01:09
threads Pin Man CD Forum Support 1 23-02-2003 19:49


All times are GMT -5. The time now is 02:40.

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