Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!pt.cs.cmu.edu!wb1.cs.cmu.edu!avie From: avie@wb1.cs.cmu.edu (Avadis Tevanian) Newsgroups: comp.os.mach Subject: Re: Combining UNIX-style and MACH-style messaging Message-ID: <8604@pt.cs.cmu.edu> Date: 26 Mar 90 22:56:36 GMT References: <39068@cornell.UUCP> Distribution: comp Organization: NeXT, Inc. Lines: 22 In article <39068@cornell.UUCP> ken@cs.cornell.edu (Ken Birman) writes: >So how about it, Rick? Why not give me an AF_MACH socket type and >a make_unix_fdes(port-no) system call, so that I can do select and >just hack my recvfrom/sendto code... Well, if you were to do this you'd end up throwing away most of the performance gains you are after. One advantages of the Mach interface is that you can effectively combine the UNIX select/recv into just one call, msg_receive. Besides, the code is actually not that difficult. The way we do this in NextStep is to assume that the majority of communication occurs using Mach IPC (it does). All of the main pathways are IPC based, if someone also wants to wait on a fd, a separate thread does the select and sends a message to the main thread with data is available. The common case is super fast, the less common case is not a lot slower than it was before (the additional context switch is negligible when compared to the costs of the write/select/ read). -- Avadis Tevanian, Jr. (Avie) Manager, System Software NeXT, Inc. avie@NeXT.COM