Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Mar 2003 15:34:44 -0500 (EST)
From:      Daniel Eischen <eischen@pcnet1.pcnet.com>
To:        Jeff Roberson <jroberson@chesapeake.net>
Cc:        Scott Long <scott_long@btc.adaptec.com>
Subject:   Re: 1:1 threading.
Message-ID:  <Pine.GSO.4.10.10303281526180.16659-100000@pcnet1.pcnet.com>
In-Reply-To: <20030328151526.S64602-100000@mail.chesapeake.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 28 Mar 2003, Jeff Roberson wrote:

> On Fri, 28 Mar 2003, Daniel Eischen wrote:
> 
> > On Fri, 28 Mar 2003, Daniel C. Sobral wrote:
> >
> > > David Xu wrote:
> > > >
> > > > do you think that a multithreaded process should use more CPU time then
> > > > a single thread process, so threaded process should have higher priority
> > > > and block other single thread processes out? AFAIK, threading is not
> > > > designed for this, you may misunderstand what threading is designed for.
> > >
> > > Threading might not have been originally designed for this, but a lot of
> > > people use it this way, a lot of people *want* it this way, and POSIX
> > > specifically mandates that this way be available.
> >
> > It is available through pthread_attr_setscope().
> >
> > There's some confusion over this and the way libthr is implemented.
> > KSE's within the same KSE Group were not designed to give more CPU
> > time than a normal unthreaded/single KSE'd process.  Unless this
> > has been changed in the kernel somehow, the use of multiple KSEs
> > by libthr or libkse (in a single KSEG) will not get any more CPU
> > time than a non-threaded program.  There was some debate over
> > this, but multiple KSEs within a KSEG were _not_ suppose to allow
> > this.  You are suppose to create a new KSEG in order to get
> > this behavior.
> >
> 
> This is not how it is implemented in either scheduler that we currently
> have.  I'm not saying which way is more or less correct because I think
> you could argue either way.  We can not entirely correctly implement
> SCOPE_PROCESSES threads right now anyway.

Well, since we have KSEGs, I'd argue that this is a bug.
Perhaps it was too difficult to do this and no-one thought
you'd ever allow more KSEs in a KSEG than you have CPUs,
so that became the limiting factor.

> This being said..  It is a property of the thr system calls and not
> libthr.  I have a flags field in thr_create() that could be used to
> indicate which scope the thread should contend in.

BTW, I'm not arguing about libthr implementation here.  I'm
just stating what a KSE is (was) suppose to be (which implicitly
describes libthr and libkse behavior).

-- 
Dan Eischen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10303281526180.16659-100000>