Date: Tue, 30 Nov 1999 09:32:39 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> To: "Daniel C. Sobral" <dcs@newsguy.com> Cc: freebsd-arch@freebsd.org Subject: Re: Threads and the scheduler Message-ID: <199911301732.JAA25846@apollo.backplane.com> References: <3842DBB5.8AFC9B6@newsguy.com> <199911292022.MAA08694@apollo.backplane.com> <3843D43E.4F40A642@newsguy.com>
next in thread | previous in thread | raw e-mail | index | archive | help
:Mmmm... that's not exactly what I'm worried about. I'm thinking of
:applications which use threads to handle both i/o and cpu-bound
:tasks. Our scheduler raises the i/o-bound tasks priority and lowers
:cpu-bound tasks priority. With a program using threads to do both,
:the scheduler would end up treating the process as cpu-bound and
:lower it's priority.
:
:Ok, maybe that's fault of the application design, but still... :-)
:
:Processes with enough i/o-bound tasks to actually use up all quanta
:before running out of threads will suffer from a similar fate.
:
:--
:Daniel C. Sobral (8-DCS)
:dcs@newsguy.com
:dcs@freebsd.org
I don't think you have anything to worry about. A thread is going to go
to sleep if it has nothing to do even if all the I/O is asynchronous
(i.e. thread is mixing cpu and I/O bound elements). It isn't the I/O
that raises the priority, it is the act of the process going to sleep
that raises the priority.
The basic characteristics of a program will not change whether it is
threaded or not, because the program is still doing essentially the
same task as it was before (just a little more efficiently). So if
an unthreaded program tended to use 10% of the cpu before the same
program threaded will also tend to use 10% of the cpu.
You will wind up with something relatively close to what you had before
in regards to the scheduling.
Matthew Dillon
<dillon@backplane.com>
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199911301732.JAA25846>
