From owner-freebsd-arch Tue Nov 30 11: 4:25 1999 Delivered-To: freebsd-arch@freebsd.org Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (Postfix) with ESMTP id 4EAE414F26 for ; Tue, 30 Nov 1999 11:04:20 -0800 (PST) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.3/8.9.3) with ESMTP id UAA10151 for ; Tue, 30 Nov 1999 20:04:19 +0100 (CET) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id UAA72193 for freebsd-arch@freebsd.org; Tue, 30 Nov 1999 20:04:19 +0100 (MET) Received: from picnic.mat.net (picnic.mat.net [206.246.122.133]) by hub.freebsd.org (Postfix) with ESMTP id 4F2C814DDE for ; Tue, 30 Nov 1999 11:04:08 -0800 (PST) (envelope-from chuckr@picnic.mat.net) Received: from localhost (chuckr@localhost [127.0.0.1]) by picnic.mat.net (8.9.3/8.9.3) with ESMTP id OAA18280; Tue, 30 Nov 1999 14:03:45 -0500 (EST) (envelope-from chuckr@picnic.mat.net) Date: Tue, 30 Nov 1999 14:03:45 -0500 (EST) From: Chuck Robey To: Allen Pulsifer Cc: freebsd-arch@freebsd.org Subject: RE: Revisitted.. Threads goals.? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 30 Nov 1999, Allen Pulsifer wrote: > Please forgive me for sticking my foot into this conversation. > I'm new to FreeBSD and have only been following this conversation > for a week. I don't pretend to know a lot of the theory, or even > how threads and SMP are currently implremented in FreeBSD. You can actually catch up, the discussion is in the archives, and it's very readable. It gets ahead of me sometimes, and I do that. > The purpose of threads is to provide a more efficient method > of multitasking. The goals of threads are to: > 1) minimize the amount of memory that each thread uses, > so that many (thousands?) of threads can be created; I don't think saving of memory as such is important. We need, however, to stay within shouting distance of other threads implementations (and POSIX's idea of threads) so this goal of yours is accomplished, but it's not a main goal of our effort. The fact of it being a shared memory area gives that as a side effect. Some other goals, like efficiency, motivate a shared memory area, which in turn give lower memory usage, but that's a result, not a goal. > Other items > may be shared or not shared depending on what > you are trying to accomplish. A lot of the decisions > are tradeoffs between functionality and efficiency. > For example, it would seem desirable to make the > unshared structures as small as possible, to > minimize memory use; No, it's *not* to minimize memory use. Considerations here are that increasing the amount of thread data may possible have some effect on thread context switching, and the complications of that. Memory usage is not really at all a factor. however, that may sacrifice > functionality. I am not familiar with all of the > structures involved, but maybe someone would make > a list: what structures must absolutely be > unshared, and what structures can optionally be made > unique, and what features or functionality are gained > by making them unique? A list like this would assist > in the tradeoff analysis and decision making. This isn't possible until the general strategy for implementing the threads is decided upon. The tradeoffs being considered are increased functionality against increased complexity. We want every possible feature, but if we make it too complicated, it will never be accomplished, or it will never really work bug-free. Thus we are exploring strategies to limit the complexity while increasing the things we do want, like reliability, efficiency (in use of resources), and simplicity. > Implementation details aside, it seems to me that one > of the major points Matt Dillion is looking for is > the ability for two threads, bound to the same > process, to run simultaneously on two different > CPU's. This seems to be a very desirable goal, > however, the question seems to be, what is the cost > of implementing this in terms of complexity and level > of effort? It's a key goal, and not even really subject to any argument so far. We already *do* have user-mode threading, that doesn't give this feature, and it has very obvious and regreattable consequences to efficient use of resources. Very definitely, we want N threads to be able to make use of M processors. This is extremely well documented in the mail archives. > In addition, if it is guaranteed that a thread will > not surrender the CPU to another thread in its same > process except at certain well defined times > (a voluntary surrender, a system call, a signal) > does that simplify user programming even more? Then it would no longer even fit any current thread standard, and really be close to useless for the majority of threaded programs. > Do these gains in simplicity make it worthwile > not implementing what might otherwise be a > powerful feature? I hate to say it, but it's a large step down in usefullness of our current user-mode threads, which are in themselves now considered less than optimally useful, and certainly less than optimally efficient (else this discussion would not be taking place). ---------------------------------------------------------------------------- Chuck Robey | Interests include C programming, Electronics, 213 Lakeside Dr. Apt. T-1 | communications, and signal processing. Greenbelt, MD 20770 | I run picnic.mat.net: FreeBSD-current(i386) and (301) 220-2114 | jaunt.mat.net : FreeBSD-current(Alpha) ---------------------------------------------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message