1:1 threading.
Daniel Eischen
eischen at pcnet1.pcnet.com
Fri Mar 28 11:28:26 PST 2003
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.
--
Dan Eischen
More information about the freebsd-arch
mailing list