You are not logged in.

#1 2010-07-28 19:07:22

Basu
Member
From: Cornell University
Registered: 2006-12-15
Posts: 296
Website

Assigning a thread to a core

For my honors thesis I'm experimenting with creating an object oriented programming language where objects are automatically assigned to cores on a multicore CPU. Though I'm familiar with the general hardware structure of multicore CPUs I don't know how the software interface works. In particular, I want to know if it's possible to poll a CPU for information about it's cores and then assign a process thread to a particular core? I've done some reading and it seems that in general the OS scheduler handles this. Is there someway around this?
Thanks,
Basu


The Bytebaker -- Computer science is not a science and it's not about computers
Check out my open source software at Github

Offline

#2 2010-07-28 19:17:39

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Assigning a thread to a core

> assign a process thread to a particular core
I'm not sure if you can do this in Linux.

Offline

#3 2010-07-28 19:21:26

tavianator
Member
From: Waterloo, ON, Canada
Registered: 2007-08-21
Posts: 859
Website

Re: Assigning a thread to a core

man sched_setaffinity will tell you how to bind a task to a set of processors/cores/threads (in the hyperthreading sense).  See also man taskset.

/proc/cpuinfo will tell you which processor ids correspond to which actual processors and cores and everything else.  Not sure if there's a more programmatic way to glean this knowledge.

Offline

Board footer

Powered by FluxBB