LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-31-2010, 02:45 AM   #1
arielsegal
Member
 
Registered: Jul 2007
Posts: 38

Rep: Reputation: 15
Multi-core support in Linux


Is there any Linux API that will let me control on what core will a thread run?
If not, do I have to use assembly language?
 
Old 10-31-2010, 07:13 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
My understanding is that you can use pthread_setaffinity_np to do this (affinity being the term used to indicate scheduling across multiple processors).

Last edited by neonsignal; 10-31-2010 at 07:18 AM.
 
Old 10-31-2010, 07:48 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Bad idea - really bad idea to design this into code.

Technology continues to evolve - as do programming paradigms. Better that this be a "late binding" decision - cgroups for example.
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to support multi-dvd to install linux? water_core Linux - Distributions 3 08-18-2010 08:09 PM
Multi-chip Multi-core pthreads question sysbox Linux - Software 0 05-03-2010 06:29 PM
LXer: Native Multi-Touch Support On Linux LXer Syndicated Linux News 0 06-11-2009 05:00 PM
Multi-core Linux starsky512 Linux - Hardware 1 02-19-2009 11:15 AM
Debian Multi Core support? ThaHabbis Linux - Server 1 03-18-2008 11:26 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration