Re: Threads and SMP kernel scheduling

2009-01-09 Thread Mehmet Ali Aksoy TÜYSÜZ
Hi,

Thank you very much again Ulf.

I found this http://en.wikipedia.org/wiki/Native_POSIX_Thread_Library and it
describes 1:1 correspondence of Linux threads. So, you were right and thank
you very much again.

Regards,

Mehmet




On Thu, Jan 8, 2009 at 4:59 PM, Ulf Lilleengen ulf.lilleen...@gmail.comwrote:

 On tor, jan 08, 2009 at 09:16:26am -0500, Mehmet Ali Aksoy TÜYSÜZ wrote:
  Hi,
 
  Thank you very much for your response Ulf. It is a very clear answer.
 Thanks
  again.
 
  By the way, any information for the Linux case?
 
 I think this applies to Linux as well, since it's NPTL(Native Posix
 Threading
 Library) uses a 1:1 mapping also. I'm not 100% sure, so you might want to
 ask
 on a linux mailing list.

 --
 Ulf Lilleengen

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Threads and SMP kernel scheduling

2009-01-08 Thread Mehmet Ali Aksoy TÜYSÜZ
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?

2-) What if there are multiple processes which have multiple threads? Does
it change the answer of (1)?

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.)

Thanks everybody in advance.

Mehmet
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Threads and SMP kernel scheduling

2009-01-08 Thread Ulf Lilleengen
On Thu, Jan 08, 2009 at 04:23:08AM -0500, Mehmet Ali Aksoy TÜYSÜZ wrote:
 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 thread
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 cores
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
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Threads and SMP kernel scheduling

2009-01-08 Thread Mehmet Ali Aksoy TÜYSÜZ
Hi,

Thank you very much for your response Ulf. It is a very clear answer. Thanks
again.

By the way, any information for the Linux case?

Regards,

Mehmet



On Thu, Jan 8, 2009 at 10:08 AM, Ulf Lilleengen ulf.lilleen...@gmail.comwrote:

 On Thu, Jan 08, 2009 at 04:23:08AM -0500, Mehmet Ali Aksoy TÜYSÜZ wrote:
  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 thread
 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 cores
 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

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Threads and SMP kernel scheduling

2009-01-08 Thread Ulf Lilleengen
On tor, jan 08, 2009 at 09:16:26am -0500, Mehmet Ali Aksoy TÜYSÜZ wrote:
 Hi,
 
 Thank you very much for your response Ulf. It is a very clear answer. Thanks
 again.
 
 By the way, any information for the Linux case?
 
I think this applies to Linux as well, since it's NPTL(Native Posix Threading
Library) uses a 1:1 mapping also. I'm not 100% sure, so you might want to ask
on a linux mailing list.

-- 
Ulf Lilleengen
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org