OS2 LANs, Part Two

team lib

OS/2 LANs, Part Two

OS/2 is not a multiuser operating system, but its multitasking ability provides the basis of support for multiuser client-server and distributed applications the real network-intrinsic applications especially once a tightly integrated network operating system is added. To make this transition, a mechanism by which the processes communicate is needed. This mechanism is an interprocess communication (IPC).

IPC Overview

There are many forms of interprocess communication. Microsoft Windows and Apple Macintosh users are familiar with one of the simpler types. Cutting and pasting data from one program into another using the clipboard is interprocess communication. OS/2 supports this type of data exchange, and much more, since it has more sophisticated interprocess communication capabilities.

OS/2 has a set of APIs that allow programmers to write applications that communicate while running concurrently on an OS/2 PC. More importantly, OS/2 APIs allow programmers to divide one program into multiple parts called processes or threads. These threads can communicate with each other. The advantage is increased speed and specialization. Different processes of a program may be tailored to fit particular tasks . Then, by running the processes simultaneously , instead of sequentially, each will complete its task more quickly.

There is also bigger advantage, OS/2's APIs allow one process to be shared by many others. This forms the basis of a client-server application. Imagine starting a program that sorts and stores raw data, like names, company names , addresses, and telephone numbers . We'll call this the database server application. Then start two more programs: a report writer and an address book. With OS/2 APIs, it is possible for the report writer and address book to get all their data from the database server at the same time. They don't have to handle sorting and storing the data; they just ask for and receive the data.

The advantages are tremendous. Because they don't have to handle data, the report writer and address book are much easier to program. Second, because each program has less to do, it can be more specialized. Third, because both use the database server, they can share information. For example, information added into the address book may be used in the report. Fourth, the programs can run concurrently, allowing a report to be run while the address book finds and displays addresses. Finally, data is not the only shared element. The address book might signal the database server to perform some task (other than a data transfer). This revolutionized what can be done on a PC.

Now imagine putting the address book on one machine, the report writer on another, and the database server on a third, and having them all work as if they resided in the same machine. Such a network-intrinsic application changes the face of computing.

OS/2's IPC

An understanding of the tools of interprocess communication is essential. There are five mechanisms: shared memory, flags, semaphores, queues, and pipes.

Shared memory is a portion of memory that multiple processes can access. Process A puts data into the shared memory space. Then Process B gets it out. OS/2 ensures the two don't collide.

Flags are signals that processes give to each other. One process issues a flag and the others look out for that flag. When it is received, a particular action is taken.

Semaphores are similar to flags, except semaphores are used to exchange data, rather than for alerts. Semaphores might be used to coordinate the use of shared memory, for example.

Queues are a place for one process to put data in and another process to take data from. In OS/2, queues are not necessarily first-in, first-out. The receiving program may take data out of the queue in any order.

Pipes are like queues except they are first-in, first-out. One process opens the pipe and sends data through it to the receiving process.

In regard to the network, queues and pipes are the most important IPC. OS/2 queues and pipes are easier to use than many IPCs. A programmer can open , read, and write to pipes as if they were files, which are very familiar operations. OS/2 handles all the tasks behind setting up the pipes and queues. This is a tremendous boon for the programmer.

So far, all these IPCs work only within one OS/2 machine. With the addition of a network operating system, OS/2's IPC and multitasking features can be extended over a network.

Network IPC

The key to extending OS/2's features over a network is an API for IPC. Many are available, but NetBIOS, APPC, and Named Pipes are the most important. None is exclusive to OS/2, but Named Pipes was developed for OS/2. The three have similar goals, but accomplish them differently.

NetBIOS is the basis of IBM's PC LAN Program and Microsoft's MS-Net. IBM originally developed APPC for communications among mainframes and midranges, but it has extended it to include PCs. Named Pipes was developed by Microsoft as an extension to OS/2's pipes. Because of the volume of programs in existence, more programmers are familiar with NetBIOS than APPC or Named Pipes.

The differences between the three IPC APIs are their sizes and ease of use. APPC is more sophisticated than Named Pipes and NetBIOS, but it requires much more memory. APPC and NetBIOS are more difficult to write to than Named Pipes. Named Pipes contains much of the logic necessary to set up communication between two processes, which makes it easier to develop client-server and distributed applications. With so much network logic already embedded in the API, using Named Pipes can increase the application's performance since fewer messages need to be passed between processes.

By combining multitasking and interprocess communication, OS/2 provides a platform upon which to build multiuser, distributed network-intrinsic applications. Add a tightly coupled network operating system and OS/2 LANs can do things never done before on a PC.

This tutorial, number 15, by Aaron Brenner, was originally published in the October 1989 issue of LAN Magazine/Network Magazine.

 
team lib


Network Tutorial
Lan Tutorial With Glossary of Terms: A Complete Introduction to Local Area Networks (Lan Networking Library)
ISBN: 0879303794
EAN: 2147483647
Year: 2003
Pages: 193

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net