Go to Post It's not just well and good that students are being inspired, it's the whole dang point. - James1902 [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 Rating: Thread Rating: 6 votes, 5.00 average. Display Modes
  #16   Spotlight this post!  
Unread 13-01-2015, 11:23
matan129 matan129 is offline
Registered User
FRC #4757 (Talos)
Team Role: Programmer
 
Join Date: Oct 2014
Rookie Year: 2015
Location: Israel
Posts: 19
matan129 is an unknown quantity at this point
Re: Utilizing Both RoboRIO Cores

Quote:
Originally Posted by SquishyIce View Post
I can't seem to find the task class in my WPILib API. Could it be under a different name? Also, how exactly would I create a new thread and populate it with instructions/commands? Sorry, I'm entirely new to this concept and pretty much have no clue what I'm doing.
I'm on my laptop and I don't have the 2015 WPILib there, but in 2014's there's a task class.
https://github.com/Talos4757/wpilib/blob/master/Task.h
https://github.com/Talos4757/wpilib/...aster/Task.cpp

It uses the VxWorks TaskLib (which is probably POSIX compatible). I think that thhis year they use POSIX threads since the RoboRIO runs Linux (with RT extensions).
  #17   Spotlight this post!  
Unread 13-01-2015, 18:41
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,173
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: Utilizing Both RoboRIO Cores

The vxWorks taskLib is the native interface for creating and manipulating new tasks - it is not POSIX. But VxWorks has a POSIX compatible library if it was included - I do not remember if it was or not.

The POSIX call to create a new thread is pthread_create and you can associate the thread with a particular core using sched_setaffinity (after the thread is running) or with pthread_setaffinity_np (to setup thread attributes before the thread is started).

Whether you should or not depends on the toplogy of your application. Remember that switching from one thread to another running on a different core can be as time consuming as switching between threads that are part of different processes.
__________________
Fast, cheap or working - pick any two!
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 00:16.

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