On 2/2/06, Bakul Shah wrote: > > > >> one disadvantage of the library approach in the unix environment is > that > > >> you're once again back having to know which `access method' to use, > > >> to pass the file descriptor or handle to the right library. > > >> i might easily have misunderstood something though. > > > > > [reasonable explanation deleted] > > > I bet they do something along these lines. > > > > yes, i supposed it could be something along those lines but i didn't > make my > > point clear. > > if it is along those lines, it breaks something that even sockets didn't > brea > > k. > > at the moment, i get a file descriptor that i can pass to anything that > does > > read and write. > > now i've got something that i can only mmap, and even the mmap refers to > a > > non-trivial data structure shared with the kernel, and the recipient of > the f > > ile descriptor > > must invoke special calls in a special library (ie, the `access > method'). > > i suppose you could call it TCAM > > Once you have mmap (and most versions of Unix do these days) > you have already bought into the associated complexity. If > you pass a file descriptor with an associated mmap to a > process, what happens is determined by mmap flags used when > the mapping was created. So all I am saying is that there > is nothing "special" about it. It is no more "broken". And > at least this is a useful extension (in that it can make the > kernel simpler without losing performance if they take out > any compatibility crap). If you exclusively used mmap for > files, even more stuff can potentially be taken out of the > kernel -- just pass the received data map directly to the > file server process. > And with 64bit Virtual Memory why not mmap everything? [except for the thrashing on my poor hard disk and lack of terrabytes of physical memory :)] I jokingly have been saying this to only close personal friends for a while. Why can't I mmap a remote process's memory? Some embedded systems [used to?] let me do this and pass messages with memcpy :). Throw off the shackles of "read" and "write" calls.... use mmap instead :) *chuckle*