Binding a process to a specific processor.

Binding a process to a specific processor.

Post by Brian D. McGr » Fri, 31 Oct 2003 03:05:21



Good morning and greetings from San Diego; I hope this is the right
group to post this request in.

We're using Redhat 7.3, kernel 2.4.20-SMP_i686, glibc 2.2.5.  Now,
here's where it gets sticky.  We' write custom software to talk to our
machines.  In our software, there are several different programs (and
processes) that run.  For instance, we have a barcode process, an
inspecter process, a material handling process, etc.

The issue that we're having is that when we start our main program, it
starts all of the sub processes and they get assigned to a processor
at random (dual processors).  I need to know, if there is a way to
assign a specific program to a specific process.  We're using C++,
gcc-3.2.

Again, we start our main program (which is called ui 'user interface')
and it in turn starts eight different progrrams.  I need to be able to
assign these programs to a specific processor.  Reason being, when
these programs are running, they pass messages back and forth and on a
dual processor system, our messages are getting clobbered.  Of course,
on a single processor system, life is good.

Any help would be great, or you can just point me off in the right
direction.  If I can't get some help pretty quick (like within a few
hours) I'm going to have to resort to using a MySQL database for
passing messages around.

Thanks in advance.

-brian

 
 
 

Binding a process to a specific processor.

Post by M?ns Rullg? » Fri, 31 Oct 2003 03:08:05


Don't multipost.

--
M?ns Rullg?rd


 
 
 

Binding a process to a specific processor.

Post by Steve Wolf » Fri, 31 Oct 2003 06:27:34


Quote:> Again, we start our main program (which is called ui 'user interface')
> and it in turn starts eight different progrrams.  I need to be able to
> assign these programs to a specific processor.  Reason being, when
> these programs are running, they pass messages back and forth and on a
> dual processor system, our messages are getting clobbered.  Of course,
> on a single processor system, life is good.

   Unfortunately, the answer is that you can't, and you shouldn't.  The
kernel is able to make MUCH more informed decisions than you are, and it's
able to make them thousands of times per second.

  If your messages are getting clobbered back and forth, the problem is
likely in your code, and you need to find a safer way of passing messages.

Quote:> Any help would be great, or you can just point me off in the right
> direction.  If I can't get some help pretty quick (like within a few
> hours) I'm going to have to resort to using a MySQL database for
> passing messages around.

  Using an RDBMS to pass inter-process messages is just about the worst
solution I can think of.  Why don't you tell us how you're passing the
messages, and we'll see what we can work out?

steve

 
 
 

Binding a process to a specific processor.

Post by Andreas Stahe » Fri, 31 Oct 2003 16:41:12



Hello

you wrote

Quote:> The issue that we're having is that when we start our main program, it
> starts all of the sub processes and they get assigned to a processor
> at random (dual processors).  I need to know, if there is a way to
> assign a specific program to a specific process.  We're using C++,
> gcc-3.2.

There is an article in Linux Journal (July 2003) by Robert Love on
"CPU Affinity" on exactely this topic.

But I dare asking: are you sure that this is the right approach?
There are good reasons to lock a process to one CPU, but I do not see
one of those reasons in yuor problem.

Enjoy this day

Andreas
===========================================================================

Mathematics, HTI     Phone: ++41 +32 32 16 258
Quellgasse 21        Fax:   ++41 +32 321 500
CH-2501 Biel         WWW:   www.hta-bi.bfh.ch/~sha
Switzerland

 
 
 

1. Question on dedicating a processor to a specific process

Is it possible under Solaris 2.x (2.6 and up) to configure a multi-processor
machine (SPARC) to assign a dedicated processor to a specific application
process?  I need to have a web-server running on the server and then another
application running on a dedicated processor...

Thanks

2. BUG, trident.c doesn't compile in 2.5.31

3. Limiting a process to specific processor(s)

4. Raw Write To CDRW?

5. Can you tie certain processes to a specific processor?

6. Booting Potato on Jensen

7. restricting a process/job to run on a specific processor..

8. How to i bind a process to a specific port

9. Hot to bind a process to a specific CPU?

10. Binding a process to a specific CPU on an SMP machine?

11. what process bind to what processor ?

12. Binding a process to a processor