From owner-freebsd-hackers Wed Feb 17 3:59:17 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from bbs.mpcs.com (bbs.mpcs.com [209.101.88.2]) by hub.freebsd.org (Postfix) with ESMTP id 6DBCC10EC6 for ; Wed, 17 Feb 1999 03:59:07 -0800 (PST) (envelope-from hg@penny.n2wx.ampr.org) Received: from pickle.n2wx.ampr.org (cc1017255-a.srst1.fl.home.com [24.3.122.197]) by bbs.mpcs.com (8.8.8/8.8.8/MPCS spamzap) with ESMTP id GAA21616; Wed, 17 Feb 1999 06:59:05 -0500 Received: (from root@localhost) by pickle.n2wx.ampr.org (8.9.2/8.8.2/n2wx) id GAA32962; Wed, 17 Feb 1999 06:59:03 -0500 (EST) Received: from penny.n2wx.ampr.org (penny.n2wx.ampr.org [172.16.0.5]) by pickle.n2wx.ampr.org (8.9.2/8.9.2/n2wx) with ESMTP id GAA32956; Wed, 17 Feb 1999 06:58:54 -0500 (EST) (envelope-from hg@n2wx.ampr.org) Received: (from hg@localhost) by penny.n2wx.ampr.org (8.9.2/8.8.8/n2wx) id GAA10270; Wed, 17 Feb 1999 06:58:53 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14026.44797.255019.909901@penny.south.mpcs.com> Date: Wed, 17 Feb 1999 06:58:53 -0500 (EST) From: Howard Goldstein Reply-To: hgoldste@bbs.mpcs.com To: Terry Lambert Cc: freebsd-hackers@freebsd.org Subject: Re: portability of shm, mmap, pipes and socket IPC In-Reply-To: <199902140105.SAA01804@usr06.primenet.com> References: <14021.27462.556760.465144@penny.south.mpcs.com> <199902140105.SAA01804@usr06.primenet.com> X-Mailer: VM 6.62 under Emacs 19.34.1 Organization: disorganization Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Terry Lambert writes: > > > > Realtime signals would help almost as much, perhaps in a more portable > > > > way. > > > > > > man setitimer > > > > 'Sir, may I please have some more?' > > > > I use it...I always feel dirty when I have setitimer signal a clumsy > > monolith that is itself in many ways like the one that deals with the > > aftermath of a select(). More timers, a la posix realtime signals > > (p1003B? I'm sure I'm citing the wrong posix id) would be cleaner, > > and would make it easier to write pthreaded applications. > > Silly Oliver Twist... POSIX is getting more and more barnacle > encrusted as time goes on. The POSIX stuff is to the point now > that it should be implemented in libraries, instead of kernels, > so that the majority of it can be ignored, while still allowing > you to claim conformance. Agreed. However, implemented as a library, will I be able to claim performance? A very quick dejanews scan seems to hint that libraries are not an uncontroversial place for them to reside in. > My personal preference for high concurrency, low overhead, SMP > scalable threads is a user space scheduler that consumes async call > gates. POSIX chickened out on this, and there are still calls that > you can make that force you to give away your quantum, and which > have no async alternatives. (Forced timeslice donation below) SMP changes things a lot, doesn't it... Nice part is there's a lot of new trail to blaze. Kind of starting to feel like around 20 years ago, minus Reagan and Blondie. > 'Some calls are more async than others.' > > >From my point of view, if the scheduler gives me a quantum, then > *it's MY quantum*, and anything that makes me "give part of it back" > for the dubious benefit of making a blocking call and taking a full > context switch is just plain stupid. A call that blocks can be a good thing. It all depends on what you're trying to accomplish, whether those other processes eating up cycles are also your processes or someone you don't really care about too much. Awaiting i/o, or expiration of a timer, these things seem like they could be more efficiently resolved in the kernel during blocking calls, at least when those other processes are mine! POSIX-like [*] realtime signals managed by the kernel potentially eliminate the userland dispatching stuff, resulting in even more joyful blocking. Granted, one man's dread is another man's joy... [*] it isn't so much conformance to a doc as it is the functionality that I sought, and nb., that was fallback functionality. If I have a modified time value in a modified select() I'll slink away from this. > See the other thread in this forum on FreeBSD vs. Network Appliance > market niches. NetApp uses a non-preemptive multitasking and > multithreaded kernel. This is good, because it eliminates context > switch thrashing. This is bad, because it's not SMP scalable, and, > like Windows 3.1, you have to trust all of your threads of execution > to "play nice". An async call gate, combined with a user space > scheduler, resolves the context switch thrashing equally well, while > still allowing the SMP scalability, and taking into account that > God can't write all of your threads of execution at the cost of > minimally necessary context switch overhead. Whee! I haven't reviewed that thread at any length; I'll try this weekend. It seems every significant packet switching project I've ever worked on we've either rolled our own non-preemptive executive (sans threads) or used something near-off-shelf (Hagar in a mostly X.25 switch comes to mind). I'm not sure a comparison is valid give the limited scope of what the o/s in a switch has to deal with compared to the more generic kinds of things we have to serve up in FreeBSD. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message