From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,541ed9334ac0c7ee X-Google-Attributes: gid1164f8,public From: Peter.Mayne@cao.mts.dec.com (Peter Mayne) Subject: Re: Locking Processes Into CPUs on AXP machines Date: 1995/04/26 Message-ID: <3nkbn9$jvp@jac.zko.dec.com>#1/1 X-Deja-AN: 101595456 references: <1995Apr25.175938.24679@eos.arc.nasa.gov> organization: Digital Equipment Corporation reply-to: Peter.Mayne@cao.mts.dec.com newsgroups: comp.sys.dec In article <1995Apr25.175938.24679@eos.arc.nasa.gov>, maclure@eos.arc.nasa.gov (IanMaclure) wrote: > On a multi-processor AXP ( 2100? ) ( under OpenVMS and OSF1 ) is > it possible to specify that a given process be loaded into a > predetermined CPU and remain there for the life of the process. > I am definitely not interested in SMP as the processes are NOT > in general symmetric. I'm not sure what you mean by processes not being symmetric, but one of the benefits of SMP is being able to dynamically schedule a process on any processor. However, for Digital UNIX: runon(1) SYNOPSIS runon cpu_num command [command_args] DESCRIPTION The runon utility runs command on CPU number cpu_num. The command_args parameter indicates flags or arguments, if any, that are specified for com- mand. All threads created by command will inherit the CPU binding cpu_num. This includes threads created as the result of a fork. bind_to_cpu(3) SYNOPSIS #include #include int bind_to_cpu( pid_t pid, unsigned long cpu_mask , unsigned long flag ); DESCRIPTION Upon return from bind_to_cpu, all threads of the target pid are running on the target CPU. Bound threads are not eligible for execution on any other CPU. You release CPU binding by invoking bind_to_cpu with a cpu_mask of zero. And if you use threads: pthread_bind_to_cpu_np(3) SYNOPSIS #include int pthread_bind_to_cpu_np( pthread_t *thread , unsigned long *cpu_mask ); DESCRIPTION This routine binds a thread to a particular processor on a multiprocessor system. Once bound, a thread will only run on the specified CPU until the thread terminates, or the binding is changed. Specify a cpu_mask of 0 to allow a previously bound thread to execute on any available CPU. PJDM -- Peter Mayne | My statements, not Digital's. Digital Equipment Corporation | Author of NTj. Canberra, ACT, Australia | "Shine on, you crazy Alpha."