home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / programm / 5169 < prev    next >
Encoding:
Internet Message Format  |  1992-11-06  |  1.7 KB

  1. Path: sparky!uunet!ferkel.ucsb.edu!ucsbcsl!mcl!jfoster
  2. From: jfoster@mcl.ucsb.edu (Joe Foster of Borg)
  3. Newsgroups: comp.unix.programmer
  4. Subject: disk buffer size, portable record locking, cabbages, and kings
  5. Summary: How to maximize portability and efficiency in block-oriented programs?
  6. Keywords: disk buffers record locking
  7. Message-ID: <jfoster.720986597@mcl>
  8. Date: 5 Nov 92 18:03:17 GMT
  9. Sender: root@ucsbcsl.ucsb.edu
  10. Lines: 31
  11.  
  12. [This is a re-post. I can't figure out what happened to my
  13. original post. Looks like the staff here have been monkeying with
  14. news again. Aargh! :-(]
  15.  
  16. I'm currently working on a distributed database library which
  17. supports variable-length records and BLOBs, for things like
  18. images, sound samples, formatted text objects, etc. (Right now,
  19. it's a quite serviceable persistent virtual array library!) I
  20. want the thing to be as portable as possible, but the only
  21. systems I current have access to are SCO Xenix/286 2.3.2,
  22. Xenix/386 2.3.4, and some Sun/3's. I have the following
  23. questions:
  24.  
  25. 1) Where is the best place to look for the disk block size? Calls
  26. to read() and write() seem to be faster when the size of the
  27. buffers passed to them are the same as the blocks in the kernel
  28. disk cache. Also, passing arbitrarily-sized buffers to reads and
  29. writes to raw disk devices seems to bomb. Again, the buffers seem
  30. to need to be the same size as the blocks in the disk cache.
  31. What .h file is best to look at? Is the #define fairly standard?
  32.  
  33. 2) What is the most portable way to do record locking? Currently,
  34. I'm using fcntl(), since it's present on both the Suns and on
  35. Xenix and supports both read and write-locks. Is this method
  36. supported by NFS's lockd and/or other network file-sharing
  37. schemes?
  38.  
  39. Thanks in advance for your help!
  40.  
  41. Joe Foster
  42. jfoster@mcl.ucsb.edu
  43.