Chapter 27 . (My web server) Programming Environments and Interfaces 697

Chapter 27 . Programming Environments and Interfaces 697 The file metaphor works this way because Linux treats all devices, such as modems, monitors, CD-ROM drives, disk drives, keyboards, mice, and printers as if they were files. Device drivers, which are part of the kernel, sit between a device and the user, and applications trying to access it translate an application s write() call into a form that the device the driver operates can understand. So, if you write data to a text file on an ext3 file system, the ext3 driver writes the necessary bytes to a file on the disk, but if you write that same data to a printer, the printer driver transmits that data out the parallel port (or across the network) and to the printer in a manner that the printer can understand and interpret. This is one way in which the Linux development environment informs, or defines, writing programs on a Linux system. The catch? If the device you want to use doesn t have a driver, you can t use the write() call to do anything with that device. You simply do not have a way to communicate with the device. This is how the Linux development environment constrains programming on a Linux system. What, then, in addition to the file idiom already discussed, are the key features of Linux that characterize its development environment? In no particular order: . The process model . CPU and memory protection . The security model . Preemptive multitasking . Its multiuser design . Interprocess communication . The building blocks approach Let s take a closer look at each of these features. The Process Model The process model is the way that Linux creates and manages running processes. Provided that a process has the necessary privileges, it can create (or spawn) other processes, referred to as child processes. The parent process can also exchange data with child processes. Of course, the capability to create child processes is not unique to Linux, but the particular way in which Linux does so is characteristic of all UNIX-like systems. Actually, the child process created when a process fork()s, isn t an exact duplicate of the parent. The process ID (PID) of the child process is different, as is the parent PID (PPID); any file locks held by the parent are reset; and any signals pending for the parent are cleared in the child. Note
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.

Leave a Reply