Building application Interleaved way
As a programmer, who believes that what can be executed is the reality, develops application base on the Linux operating system, you must know that an application is running in two fundamental visualized space: virtual memory and visualized processor, kernel-space and user-space. Even, when you are programming in user-space, an entire and dynamic perspective is necessary–building application in an interleaved way between operating system and application.
Because your application is running in an easily interrupted space–interrupt event, random exception, system timer waking. It is a false appearance that a concrete application is monopolizing the whole machine. Considering applications and operating system as entire picture is a basic strategy while you are designing an application–multiprocessing, multitasking(multithreading), IPC, and critical regions protecting.
As a whole dynamic system, software runs in an interleaved way with the hardware to process the random and different events.
Then, when you want to build an application or try to model a dynamic system, you must think as the system works, you are the system.
Now, considering the multiprocessors environment when you design the concurrent dynamic system. Multiprocessors provide a real parallel environment–instructions execute in different cores without the operating system’s scheduling, therefore, leaving the operating system kernel and user processes much tough stuff to deal with, i.e., synchronization among kernel control paths, user control paths or both.
Hardware and software on which the application would run influence the synchronization strategy employed by the system. Synchronization among different processes is more difficult than what to be done within the kernel space. Operation conducted by kernel scheduling due to interruption, exception and exhausted time-piece, and operation executed in other cores would access the data parallelly, interrupting the critical region. Lock, whatever, is the strategy you could use, i.e., spinlock, mutex, semaphore, read/write spinlock and read/write semaphore.
succinctly. Preliterate eternal vigilance obfuscate
(Object-oriented programming is a philosophy that attempts to mold the language to fit a problem instead of molding the problem to fit the language.)
1, Asynchronous I/O, for example, is often infuriating.