Re: Is it possible to make -lpthread program to use 100% CPU?

From: Daniel Eischen <eischen_at_vigrid.com>
Date: Sun, 2 May 2004 12:57:53 -0400 (EDT)
On Sun, 2 May 2004, Alexandre Sunny Kovalenko wrote:
> 
> I did mention this one ;) With older sources (kern_thread.c 1.175) I have tried
> both with the similar results. With the last update (last CTM from EST morning
> on Friday 4/30) I only tried _ULE. If you need me to try _4BSD, let me know.
> 
> Just out of curiosity, if I have 64 threads and 4 CPUs would not result be the
> same with PTHREAD_SCOPE_SYSTEM and PTHREAD_SCOPE_PROCESS, since I could not
> get more KSEGs then I have CPUs, and default is 8 threads per KSEG? Or am I
> totally off the mark?

You can have more KSEGs than CPUs.  The default is one KSEG
with N KSEs (where N is the number of CPUs).  All scope
process threads run in the N KSEs; these threads are not
bound to any specific KSE within the KSEG.

Scope system threads get their own KSEG and KSE.

I don't know how the various schedulers schedule KSEs
onto processors.

-- 
Dan Eischen
Received on Sun May 02 2004 - 07:57:54 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:52 UTC