Unix Programming - Thread(s) CPU affinity?

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > February 2006 > Thread(s) CPU affinity?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Thread(s) CPU affinity?
seenutn@gmail.com

2006-02-27, 2:48 am

Hi All,
I have an application which is multithreaded. I am running on RHEL
4 update 2 (kernel 2.6.9-5ELsmp and NPTL-2.3.4). The hardware is two
Intel Xeon each of dual core (So, effectivelt there are 4 CPUs).
I want to tie certain threads to one CPU and some other threads to
other CPU and so on. The whole process can be tied to a CPU using
sched_setaffinity system call, but how do I tie individual threads?

Regards,
Seenu.

Ian Collins

2006-02-27, 2:48 am

seenutn@gmail.com wrote:
> Hi All,
> I have an application which is multithreaded. I am running on RHEL
> 4 update 2 (kernel 2.6.9-5ELsmp and NPTL-2.3.4). The hardware is two
> Intel Xeon each of dual core (So, effectivelt there are 4 CPUs).
> I want to tie certain threads to one CPU and some other threads to
> other CPU and so on. The whole process can be tied to a CPU using
> sched_setaffinity system call, but how do I tie individual threads?
>

Even if you can, I wouldn't do so with Xeon cores. They are not true
CPUs as they share the same cache and many parts of the real physical core.

--
Ian Collins.
David Schwartz

2006-02-27, 2:48 am


"Ian Collins" <ian-news@hotmail.com> wrote in message
news:1141025880.25642@drone2-svc-skyt.qsi.net.nz...
> seenutn@gmail.com wrote:


> Even if you can, I wouldn't do so with Xeon cores. They are not true CPUs
> as they share the same cache and many parts of the real physical core.


Where are you getting that from?

DS


Ian Collins

2006-02-27, 2:48 am

David Schwartz wrote:
> "Ian Collins" <ian-news@hotmail.com> wrote in message
> news:1141025880.25642@drone2-svc-skyt.qsi.net.nz...
>
>
>
>
>
> Where are you getting that from?
>

Oops, that was complete bollocks - I was thinking hyper-threaded CPUs,
sorry..

--
Ian Collins.
iforone

2006-02-27, 7:50 am


Ian Collins wrote:
> David Schwartz wrote:
> Oops, that was complete bollocks - I was thinking hyper-threaded CPUs,
> sorry..
>
> --
> Ian Collins.


I for one, am still extremely interested where you got that information
from Ian ? -- as you may or may not know -- Intel Dual Cores can still
have HT (IIRC - the non-Xeon Pentium-D EE version does), effectively
making it appear as Quad-core (2 Physical + 2 logical cores).

Yes; Intel's implemetation of Dual Core technology is much different
than AMDs, ...the Intel Memory Controller (AFAIK even for Xeons) still
resides on the Mobo for Intel (within the Chipset), whereas the AMD64
uses it's OnDie Mem Controller (that's just the "main" difference in
architecture).

Ian Collins

2006-02-27, 8:48 pm

In-Reply-To: <1141039002.590538.169720@j33g2000cwa.googlegroups.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Organization: Customer of Mercury Telecommunications Ltd
Message-ID: <1141071271.461961@drone2-svc-skyt.qsi.net.nz>
Cache-Post-Path: drone2-svc-skyt.qsi.net.nz!unknown@202-89-155-106.ubs.qsi.net.nz
X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/)
X-Original-NNTP-Posting-Host: drone2-svc-skyt.qsi.net.nz
X-Original-Trace: 28 Feb 2006 09:14:31 +1300, drone2-svc-skyt.qsi.net.nz
Lines: 25
NNTP-Posting-Host: 203.97.37.6
X-Trace: sv3- x4iJGb+UWobYuajwl1iYp95MXKYCBWWvfYoDGDce
FoTWZsIpntRX+BRU7Yf38h6/pPs3wA8pQLDQQY5!QZNg3N3ng0O1GbI9RkbEhw/Nh3CcbT8lt2AKRYL+h4Cw51I/ XA9y6v4FrhPvCx0S3ES4zZ3BDtZk!PGJj84SaNg=
=
X-Complaints-To: Complaints to abuse@clear.net.nz
X-DMCA-Complaints-To: Complaints to abuse@clear.net.nz
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.32
Xref: number1.nntp.dca.giganews.com comp.os.linux.misc:630696 comp.programming.threads:57156 comp.unix.programmer:166349

iforone wrote:
>
> I for one, am still extremely interested where you got that information
> from Ian ? -- as you may or may not know -- Intel Dual Cores can still
> have HT (IIRC - the non-Xeon Pentium-D EE version does), effectively
> making it appear as Quad-core (2 Physical + 2 logical cores).
>
> Yes; Intel's implemetation of Dual Core technology is much different
> than AMDs, ...the Intel Memory Controller (AFAIK even for Xeons) still
> resides on the Mobo for Intel (within the Chipset), whereas the AMD64
> uses it's OnDie Mem Controller (that's just the "main" difference in
> architecture).
>

Have a google around for Hyper-thread, you will see then the technology
is based on two virtual processors sharing one physical set of
resources. It is particularly suited to the P4, which has a long
pipeline. The two virtual processors can be performing different
operations concurrently (say floating point and a fetch), but not the
same operation as there is only one physical resource set.

So there is a benefit with a varied workload, but not on CPU intensive
multi-threaded operations.

--
Ian Collins.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com