13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Inter-process communication 303its output port for printing. Each printer could wait for messages from that port whenidle, and several data sets could be printing at once. The various kinds of ports are picturedin Figure 9.6.Naming and transfer.We have seen that Unix pipes have no names butare referred to instead by pipe descriptors that act much like file descriptors. Sincedescriptors can be passed between processes only by inheritance, this naming strategylimits communication to related processes.There are many other ways to establish connections. For example, the file structurescould include port files, which are neither directories nor data files. A process thatopens a port file receives a port descriptor, which can be used for writing or reading,depending on the manner in which the port was opened. Whatever file security mechanismsare used for other files apply to port files as well.Port files are one way to associate names with ports. <strong>An</strong>other way is to have portnumbers that are globally accessible, unlike port descriptors, which have meaning onlywithin a particular process and its descendants. Some of these numbers can have a publishedand fixed meaning, such as ‘‘the port for requesting the Finger service.’’ Othernumbers could be allocated and released on demand. We could use the following servicecalls:CreatePort(port number). This call returns the number of a newly created port.If the port number given is the special value ‘‘new,’’ the port manager allocates acurrently unused number. The creating process becomes the owner of the port.free portbound portinput portoutput portFigure 9.6 Four kinds of ports

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!