APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

2003/09/15 affinity

© September 2003 Tony Lawrence

In the computer world, this is usually processor affinity, and refers to keeping a process bound to one cpu. Without this binding, a process may move to a different cpu when it is scheduled to run again, and this is apt to be deleterious to cpu cache.

SMP operating systems try to keep processes tied to the same cpu. This is usually referred to as "soft" affinity. Hard affinity means the kernel is required to keep the same cpu (or cpu's) for a specific process. This would be done by a system call either by the process itself or by some other supervisory process.

It can also be advantageous to bind threads to the same cpu if they will be accessing the same data. Of course that does negate the advantages that might be had from running the threads on independent processors. People who need to squeeze the last bit of performance from their programs agonize over such decisions.

Another use is for real-time systems. The time critical aspects get bound to one or more cpus, and other processes use whatever is left over.

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> affinity

Inexpensive and informative Apple related e-books:

Photos: A Take Control Crash Course

Digital Sharing Crash Course

Sierra: A Take Control Crash Course

iOS 10: A Take Control Crash Course

iOS 8: A Take Control Crash Course

More Articles by © Tony Lawrence

Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

Don't blame me for the fact that competent programming, as I view it as an intellectual possibility, will be too difficult for "the average programmer" — you must not fall into the trap of rejecting a surgical technique because it is beyond the capabilities of the barber in his shop around the corner. (Edsger W. Dijkstra)

Linux posts

Troubleshooting posts

This post tagged:



Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode

SCO Unix Sales, Support, & Service

Phone:  707-SCO-UNIX (707-726-8649Toll Free: 833-SCO-UNIX (833-726-8649)