[KLUG Members] How to queue jobs ?

John Pesce pescej at sprl.db.erau.edu
Tue Oct 11 11:18:41 EDT 2005


On Tue, 2005-10-04 at 09:30 -0400, Adam Tauno Williams wrote:
> > I have a multi-processor server and I want to queue jobs for these
> > processor. Means, when I fire an application, I want this application
> > should be processed by CPU-1; next application should be processed by
> > CPU-2, like wise.
> >
> > Can anyone provide me with some inputs or configuration details how to
> > do that in Red hat linux ?
> 
> http://www.linuxjournal.com/article/6799


I tried to compile the bind.c code. It seems Linux is missing something.
The Linux man page for sched_getaffinity and sched_setaffinity says they
take an unsigned long *. 

int sched_getaffinity(pid_t pid, unsigned int len, unsigned long *mask)

However, the header file says it takes a cpu_set_t pointer.
g++ throws an error that it can't convert from unsigned long* to
cpu_set_t pointer.

In the bind.c code, I changed the mask to type cpu_set_t and it
compiles, but it doesn't run.

./bind 13455 1
pid 13455's old affinity: 00000001
sched_setaffinity: Invalid argument
Exit 255


Anyone else get this to work?





More information about the Members mailing list