From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 8 14:16:28 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7A9D106566C for ; Thu, 8 Jan 2009 14:16:27 +0000 (UTC) (envelope-from aksoy.for.research@gmail.com) Received: from mail-bw0-f20.google.com (mail-bw0-f20.google.com [209.85.218.20]) by mx1.freebsd.org (Postfix) with ESMTP id 661498FC17 for ; Thu, 8 Jan 2009 14:16:27 +0000 (UTC) (envelope-from aksoy.for.research@gmail.com) Received: by bwz13 with SMTP id 13so806626bwz.19 for ; Thu, 08 Jan 2009 06:16:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=OsKrMIVQlswR782QVxZxvLMuty8fSOoTRh4aF7fTfmA=; b=C1tjnYxEcZ2wvMdW0IJh4+A7i9kiUfJ4pRbHF0UIjWajrFZE9Q4WcR2WTEMhdFuL7e kI1AVXk89PA8EEIF1oids96zEgaUSG82z8M02fpXMchf3Ksi7sM9FJEA8fwuomRviJo+ A0uTQp9+4pj25M1YGaXlbcse56SNUuinkh6BQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=DPyE0tsZd8OuBj1Q7W7d/EcQsR4oOMqrNmBDa/+wCunzDELgaMgFiah1ACiP75E9Gp D0uvKC2OGOmguTsMeijtELdEJxjyZA06kDbeXNfkEfK0OF2gSxD4xm8jD0JUZav1SQCS mJG4ULyQ7qD2Iq0/cIJbIWW9dzJVzgqU6kpsk= Received: by 10.181.149.7 with SMTP id b7mr9335540bko.210.1231424186197; Thu, 08 Jan 2009 06:16:26 -0800 (PST) Received: by 10.181.153.11 with HTTP; Thu, 8 Jan 2009 06:16:26 -0800 (PST) Message-ID: <14ded62c0901080616o68bad18cg256fa10f12c4560b@mail.gmail.com> Date: Thu, 8 Jan 2009 09:16:26 -0500 From: "=?ISO-8859-1?Q?Mehmet_Ali_Aksoy_T=DCYS=DCZ?=" To: freebsd-hackers@freebsd.org In-Reply-To: <20090108150807.GA1264@carrot.pvv.ntnu.no> MIME-Version: 1.0 References: <14ded62c0901080123u7268055epb3e17d84aa757051@mail.gmail.com> <20090108150807.GA1264@carrot.pvv.ntnu.no> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: Threads and SMP kernel scheduling X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jan 2009 14:16:28 -0000 Hi, Thank you very much for your response Ulf. It is a very clear answer. Thank= s again. By the way, any information for the Linux case? Regards, Mehmet On Thu, Jan 8, 2009 at 10:08 AM, Ulf Lilleengen w= rote: > On Thu, Jan 08, 2009 at 04:23:08AM -0500, Mehmet Ali Aksoy T=DCYS=DCZ wro= te: > > Hi all, > > > > After I had a bit googling I got confused. > > > > My questions are simple and they are as follows : > > > > 1-) "Are pthreads (or threads in general) of one process scheduled to > > different cores on multi-core systems running Linux or BSD?" > > > The standard threading library in FreeBSD will use a 1:1 mapping between > userland threads(pthreads) and kernel threads. This means that each threa= d > may run on a different core than other threads. > > > 2-) What if there are multiple processes which have multiple threads? > Does > > it change the answer of (1)? > No, the same mapping applies. Although threads of one process may > preferably > run on the same core, each thread of a process may run on any of the core= s > available. > > > > > I found some answers but they are not sharp. Somebody says "can be > > scheduled" but "can be" is not a precise answer (in my opinion.) > Well, it means that there are more factors deciding where a thread is put= . > If > you look at a factor such as affinity, one thread may preferable be > scheduled > to the same core since the cache may contain data relevant to the thread. > > > > > Thanks everybody in advance. > > > Hope everything is at least a bit clearer. > > -- > Ulf Lilleengen >