Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jan 2009 09:16:26 -0500
From:      "=?ISO-8859-1?Q?Mehmet_Ali_Aksoy_T=DCYS=DCZ?=" <aksoy.for.research@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Threads and SMP kernel scheduling
Message-ID:  <14ded62c0901080616o68bad18cg256fa10f12c4560b@mail.gmail.com>
In-Reply-To: <20090108150807.GA1264@carrot.pvv.ntnu.no>
References:  <14ded62c0901080123u7268055epb3e17d84aa757051@mail.gmail.com> <20090108150807.GA1264@carrot.pvv.ntnu.no>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <ulf.lilleengen@gmail.com>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
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14ded62c0901080616o68bad18cg256fa10f12c4560b>