Xref: utzoo comp.sys.amiga:70360 comp.sys.amiga.tech:15525 Path: utzoo!attcan!uunet!ncrlnk!ncr-mpd!Chuck.Phillips From: Chuck.Phillips@FtCollins.NCR.COM (Chuck.Phillips) Newsgroups: comp.sys.amiga,comp.sys.amiga.tech Subject: Re: UNIX sys V4.0 Message-ID: Date: 28 Oct 90 03:41:33 GMT References: <6956@uwm.edu> <9010025@hpfcso.HP.COM> Sender: uucp@ncr-mpd.FtCollins Followup-To: comp.sys.amiga.tech Organization: NCR Microelectronics, Ft. Collins, CO Lines: 60 In-reply-to: aoe@hpfcso.HP.COM's message of 24 Oct 90 19:45:08 GMT >>>>> On 24 Oct 90 19:45:08 GMT, aoe@hpfcso.HP.COM (Alexander Elkins) said: >The port is out. Ask questions about it and you will get answers. Alexander> A few more come to mind - Alexander> 7) Are shared memory segments supported? I.e. can two, or more Alexander> processes attach the same shared memory segment and read/write Alexander> to it? Shared memory is an _integral_ part of SVr4, either through the SVr3 compatible shmem interface or, better IMHO, the mmap() interface. Alexander> 8) Are virtual files supported? I.e. can a file be opened in Alexander> such a way as to map its contents to an address space in a Alexander> running process? (Great for data bases, virtual memory is then Alexander> just a special unnamed file!) Under SVr4, the VM system underwent a _radical_ rewrite. The essential difference between swap space memory mapping and file system memory mapping is that swap space is anonymous (i.e. not mapped into the file system). So to answer your questions, yes and yes. Another advantage: If your application exhausts the swap space, you can grab still more by creating a file of arbitrary size, then mmap() it into your address space on the fly. Also, by mmap()ing a file into your process's address space, you get random-access, on-demand paging of your data without system call overhead every time you change location in the file and every time you read or write to the file. Independent processes can mmap() the same file for IPC, etc, etc, etc. Alexander> 9) Does a system call to brk(1024000) followed by brk(5120) Alexander> actually return the memory to the system for use by other Alexander> processes or does the memory used by a process only increase and Alexander> not get return to the system resource memory pool until it Alexander> exits? Which happens? Once you munmap() from anonymous memory, the swap space is released back to the OS for reuse. (If your were mmap()ing a file system file, it never ate into your swap space to begin with!) Using the old brk() mechanism, you have to worry about fragmentation of the allocated space and what library routines (like malloc and fopen) may have stuffed into your address space behind your back. Unless you're doing _all_ of your own memory allocation, making your address space smaller via brk() is a _very_ dangerous thing to do. Alexander> 14) Is file locking supported? This means whole files and Alexander> blocks in a file, which is very useful for concurrent database Alexander> access. Better than by blocks, you can specify byte ranges for _advisory_ locking; you can mark ranges as locked, but only applications explicitly checking for locks will know not to access the area. #include Hope this helps, -- Chuck Phillips MS440 NCR Microelectronics chuck.phillips%ftcollins.ncr.com 2001 Danfield Ct. Ft. Collins, CO. 80525 ...uunet!ncrlnk!ncr-mpd!bach!chuckp