762 Part VI . Programming in (Web hosting support) Linux .

762 Part VI . Programming in Linux . Shared memory Shared memory is just what the name suggests: a region or segment of memory specifically set aside for use by multiple processes. Because shared memory is never paged out to disk, it is an extremely fast way for two processes to exchange data. . Semaphores Semaphores, briefly mentioned in the Preemptive Multitasking section, serve as flags that indicate a condition controlling the behavior of processes. For example, one process can set a semaphore to indicate a specific file is in use. Before other processes attempt to access that file, they check the semaphore s status and don t (or shouldn t) attempt to access the file if the flag is set. . Message queues Message queues are first-in-first-out (FIFO) data structures that make it possible for processes to exchange short messages in a structured, orderly manner. Message queues are not necessarily accessed in FIFO data structures. System V UNIX-style message queues are, but POSIX message queues enable readers to pull messages out of a queue in an arbitrary order. Shared memory, semaphores, and message queues are idiomatic in the Linux development environment. They solve three distinct domains of problems that arise when multiple processes need to exchange data or share resources without having to resort to slow disk files. All of which is to say that you don t always need IPC, but it sure is nice to have when you do need it. The Building Blocks Philosophy The building blocks philosophy that characterizes the Linux development is best expressed as a short series of rules or principles: . Do one thing very well. . Whenever possible, accept input data from standard input and send output data to standard output. . Keep individual programs as self-contained as possible. . Remember that someone will use your program in ways you didn t intend and for purposes that you never imagined. The first rule simply means that programs should not try to be all things to all people: a text editor doesn t need to be able to send e-mail messages and a drawing program doesn t also need to be able to function as a Web browser. Although it is less true today than it used to be, the best Linux programs don t have every imaginable feature (also known as featuritis). Rather, developers spend time perfecting the program s intended purpose and making it possible for programs to interoperate. Note
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.

Leave a Reply