Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Nov 1999 11:19:28 -0700
From:      Nate Williams <nate@mt.sri.com>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        "Daniel C. Sobral" <dcs@newsguy.com>, freebsd-arch@freebsd.org
Subject:   Re: Threads and the scheduler
Message-ID:  <199911301819.LAA26598@mt.sri.com>
In-Reply-To: <199911301732.JAA25846@apollo.backplane.com>
References:  <3842DBB5.8AFC9B6@newsguy.com> <199911292022.MAA08694@apollo.backplane.com> <3843D43E.4F40A642@newsguy.com> <199911301732.JAA25846@apollo.backplane.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.

Actually, not necessarily.  It may use up 'more' CPU since it can now
more 'effeciently' use all of the available quantum, instead of idling.

However, on a loaded (non-idle) system assuming the scheduler does a
good job of things, the net result should be similar.



Nate




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?199911301819.LAA26598>