home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.21 / text0161.txt < prev    next >
Encoding:
Text File  |  1990-10-26  |  5.2 KB  |  102 lines

  1. Submitted-by: donn@hpfcrn.fc.hp.com (Donn Terry)
  2.  
  3. I've been following this discussion on the issues of filesystem namespace.
  4.  
  5. I'd like to step back from the details and look at it a little 
  6. more philosophically.  I think that that may lead to a resolution of the
  7. issues (or at least some progress) (or a decrease in the shrillness)
  8. (or something).
  9.  
  10. UNIX was designed to simplify the programmer's life.  In particular, 
  11. anything that could be reasonably generalized, was.  This generalization
  12. is not an easy task, and not easy to explain.  The genius of Ritchie and
  13. Thompson was both because they acheived the generalization, and because
  14. they got others to beleive in it.
  15.  
  16. The generalization is more difficult to deal with when you are "used to" some
  17. other model.  (I see folks using various propietary systems griping about
  18. UNIX because it doesn't do everything just the way they are used to.)
  19. As Dijkstra once observed about BASIC (I paraphrase, not having the quote).
  20. "The teaching of BASIC should be forbidden because it forever ruins 
  21. students from being able to use better languages."
  22.  
  23. I think that (although he exaggerates) that Dijkstra's comment also applies
  24. in this case.  We all are contaminated to some degree or other by the 
  25. preconceptions we bring with us from other training (be it experience with
  26. other OSs or something else).
  27.  
  28. I have some personal concerns about some of the functionality in 1003.4
  29. because it appears to be based upon models from other, successful, 
  30. implementations, but ones that may not have been through the process of
  31. generalization.  It was R&T's thought that having lots of processes would
  32. solve such problems, and for the day, it did.  Now it doesn't because of
  33. tightly coupled activities (tasks?) needing "fast" switch time. 
  34.  
  35. To me, threads is the generalization that follows the original philosophy, 
  36. not bringing up the OS-like functions similar to select() to the user. 
  37. (I didn't like threads at first, like many don't; I may still not like the
  38. details, but they do seem to provide the generalization needed for 
  39. that class of task, without the application writer having to write a
  40. mini-dispatcher of his/her own.)
  41.  
  42. The broad context of namespace is similar, to me.  What's the
  43. generalization?  I don't really know.  My (UNIX flavored) biases say
  44. that it's the filesystem.  However, a generalization, not a statement
  45. that "my problem is different so must be treated differently", is the
  46. right answer. 
  47.  
  48. Let me try something for the readers of this group to think about.
  49.  
  50. The "UNIX Filesystem" really consists of two parts:  a heirarchical
  51. namespace mechanism that currently names objects which are at least
  52. files, devices, file stores (mounted volumes), and data stream IPC
  53. mechanisms (OK, FIFOs!).  Some systems add other IPC mechanisms
  54. (Streams, Sockets), and the process space (/proc.)  I could go on.
  55.  
  56. One of the class of objects named in the namespace is ordinary files.
  57. The set of ordinary files is a collection of flat namespaces, where
  58. the names are (binary) numbers.  (Each mounted volume is an element
  59. of the collection, and each i-number is a filename.  The "real names"
  60. of files are the volume and i-number pair; that's how you tell if two
  61. files are identical, not by their names in the namespace, of which
  62. they may have zero or more.)  (The fact that the other object types
  63. also usually have i-numbers is an accident of implementation.)
  64.  
  65. Open() is a means to translate from the namespace to a handle on an object.
  66. It may be that the handle is for an ordinary file, or for some other 
  67. object (as I listed above).  Historically, files were the most common
  68. concept, and the namespace becomes the "filesystem".  (The volume/inode
  69. namespace isn't, and shouldn't be, accessible, because the gateway
  70. functions that Doug Gwyn mentions are necessary and valuable.)
  71.  
  72. Given the above three paragraphs, one could consciously separate the 
  73. namespace from the file system further, and then the arguments that 
  74. "a connection is not a file" seems weaker.  A "connection" is an object
  75. in the namespace, and open() gives you a handle on it.  Given that you
  76. know what the object is, you may have to perform additional operations
  77. on it, or avoid them.  (E.g., many programs operate differently based on the 
  78. nature of the object they open; if it's a tty it does ioctl() calls on
  79. it, if not, it doesn't.)
  80.  
  81. I'm not yet sure that the "filesystem" namespace is (or is not) the
  82. right generalization, but a generalization is useful so that we don't
  83. end up were we were when R&T started out with a bunch of unrelated
  84. namespaces where, by relating them, common functions could be combined,
  85. and common operations could be performed commonly.  For example, it
  86. would be a shame if we find that some network objects that were not put
  87. in the generic namespace could reasonably have the
  88. open()/read()/write()/close() model applied to them, and because they
  89. were in a different namespace, this could not be done (easily).
  90.  
  91. Many exisiting proprietary systems (and even more historical ones) left
  92. you in the state that a program that sequentially read an ordinary file
  93. couldn't simply do the same thing to a device (without extra programming,
  94. anyway).  Not looking for the generalization could lead us to the same
  95. state again for the "newer" technologies.
  96.  
  97. Donn Terry
  98. Speaking only for myself.
  99.  
  100. Volume-Number: Volume 21, Number 161
  101.  
  102.