Date: Sun, 10 Dec 2000 15:03:11 -0800 From: "David Schwartz" <davids@webmaster.com> To: "Michael Bacarella" <mbac@mmap.nyct.net> Cc: "Noor Dawod" <noor@comrax.com>, <stable@FreeBSD.ORG> Subject: RE: MySQLd not using both CPUs Message-ID: <NCBBLIEPOCNJOAEKBEAKEECOMGAA.davids@webmaster.com> In-Reply-To: <20001210112921.A5531@mmap.nyct.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Sorry to continue this thread, but I think this last point is of sufficient general interest. I'll shut up now. ;) > On Sun, Dec 10, 2000 at 12:54:01AM -0800, David Schwartz wrote: > I think the whole 1 thread to 1 process scheme that LinuxThreads > uses would > be much slower under FreeBSD. Unless some magic has been put in > to special case this scheme in the scheduler... you'll probably see > better performance running LinuxThreads with Linux. > > -- > Michael Bacarella <mbac@mmap.nyct.net> This is why I say that LinuxThreads is better for _good_ code and libc_r is better for _poor_ code. Good code does not create more running threads than there are processes to run them on. Bad code creates tons of senseless threads, which libc_r schedules just fine and the kernel does not. If you create a thread to keep a CPU busy, then there should be a CPU to run that thread on. If you create a thread to pend a disk I/O operation, then that thread should be blocked waiting for the I/O to complete. So long as you only create threads for a legitimate reason, you will not cripple the scheduler. If you assume 2 CPUs and perhaps one can usefully pend 6 I/O operations, you're talking about 8 threads. Add another few threads so you can have one to wait for signals, one to fire timers, one to talk to a library that might not be thread safe, and you have perhaps 12 threads. If that hurts FreeBSD's scheduler, then FreeBSD is badly broken. DS To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?NCBBLIEPOCNJOAEKBEAKEECOMGAA.davids>