Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ut-sally.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!ut-sally!ark From: ark@ut-sally.UUCP (Arthur M. Keller) Newsgroups: net.unix-wizards,net.database Subject: Re: A variant of the streams idea Message-ID: <3883@ut-sally.UUCP> Date: Thu, 26-Dec-85 18:35:14 EST Article-I.D.: ut-sally.3883 Posted: Thu Dec 26 18:35:14 1985 Date-Received: Sat, 28-Dec-85 01:27:59 EST References: <2416@ukma.UUCP> <372@ncr-sd.UUCP> <964@brl-tgr.ARPA> <376@ncr-sd.UUCP> Reply-To: ark@sally.UUCP (Arthur M. Keller) Organization: U. Texas CS Dept., Austin, Texas Lines: 56 Xref: watmath net.unix-wizards:16248 net.database:164 In article <376@ncr-sd.UUCP> greg@ncr-sd.UUCP (Greg Noel) writes: >In article <964@brl-tgr.ARPA> gwyn@brl-tgr.ARPA (Doug Gwyn ) >claims that there are >>significant differences between random-access >>(disk) files and sequential (communication) >>files. To force random files into the stream >>model would require sacrificing some of their >>desirable properties (seekability, sharability, >>speed), alas. > >I'm prepared to believe that the current implementation of streams makes >this difficult or impossible, but I'm not prepared to believe that the >idea itself is difficult or impossible. Some people consider random access to be "stream access with repositioning". That might work well in a single-user environment but fails badly in a multi-user environment with concurrency control. In a file system or a database system, the granularity of locking is an important concept. It corresponds to the granularity of sharing. It may but need not correspond to the granularity of access, although the two must be comparable (equal or one contained in the other for all practical purposes). In streams, the granularity of access is not a very well defined concept. You don't really want to lock the "next 100 bytes I will next read". Rather, you probably want to lock the "next group of related fields" commonly called a record. The notion of streams generally indicates one source and one consumer for each dataflow pathway, although there may or may not be a separate, often implicit reverse pathway. The notion can be generalized to multiple producers and consumers, but still obeying a FIFO (or priority queue) discipline. No notion of modification of the data in a stream exists, although a transformer may be interposed that consumes a stream and produces another distinct stream by a transformation of the consumed stream. In a randomly accessed, shared file system, the data do not follow anything resembling a FIFO discipline. The data are not consumed, they are referenced; they may also be created, updated, and destroyed. To consider a shared file to be a stream actually means that the file is encapsulated in a process and your stream is communicating with that process. Then the process uses a more traditional discipline to interact with the file. This would involve a protocol transformation and the attendant overhead. I've only briefly touched on some of the issues, but I hope that this can give the readership of this newsgroup a feeling for the problems involved. Prof. Arthur M. Keller The University of Texas at Austin Department of Computer Sciences -- ------------------------------------------------------------------------------ Arpanet: ARK@SALLY.UTEXAS.EDU UUCP: {gatech,harvard,ihnp4,pyramid,siesmo}!ut-sally!ark