ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalDC-323Process Centric
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    DC-323

    Parallel & Distributed Computing

    Progress0 / 35 done
    Topics35
    1Asynchronous/synchronous computation/communication2Concurrency control3Fault tolerance4GPU architecture and programming5Heterogeneity6Interconnection topologies7Load balancing8Memory consistency model9Memory hierarchies10Message passing interface (MPI)11MIMD/SIMD12Multithreaded programming13Parallel algorithms & architectures14Parallel I/O15Performance analysis and tuning16Power considerations17Programming models18Data parallel programming19Task parallel programming20Process-centric programming21Shared memory programming22Distributed memory programming23Scalability and performance studies24Scheduling25Storage systems26Synchronization27Parallel computing tools28CUDA, Swift29Globus, Condor30Amazon AWS, OpenStack31Cilk32GDB for parallel debugging33Threads programming34MPICH, OpenMP35Hadoop, FUSE
    8 min read
    Topic 20 of 35
    Topic Study Note Illustration
    20

    Process-centric programming

    Process-centric programming refers to a programming paradigm in parallel and distributed computing where the primary focus is on managing and coordinating multiple independent processes. A process in...

    Process-Centric Programming

    Process-centric programming refers to a programming paradigm in parallel and distributed computing where the primary focus is on managing and coordinating multiple independent processes. A process in this context represents an isolated unit of execution with its own memory space. In process-centric programming, computation is organized around processes rather than threads, tasks, or data. These processes communicate with each other through inter-process communication (IPC) mechanisms, such as message passing or shared memory.

    In distributed systems, process-centric programming is often employed to enable the execution of independent processes across different machines or nodes in a network, with each process performing a part of the overall task. In contrast to thread-based models, processes are typically more heavyweight, with higher isolation and more overhead for inter-process communication.


    Key Concepts in Process-Centric Programming

    1. Process:

      • A process is an independent execution unit that has its own memory space, execution context, and system resources. Unlike threads, processes do not share memory space directly, which provides better isolation and protection between them.
      • Processes can run concurrently and communicate with other processes via explicit communication mechanisms like message passing or through shared memory in some systems.
    2. Inter-Process Communication (IPC):

      • Since processes have separate memory spaces, they need communication mechanisms to exchange data and synchronize. IPC mechanisms include:
        • Message Passing: One process sends a message to another. This can happen via message queues, sockets, or remote procedure calls (RPCs).
        • Shared Memory: In some systems, processes may have access to a shared memory region, allowing them to exchange data directly.
        • Pipes and Named Pipes: These are used for communication between processes, typically in a producer-consumer setup.
    3. Process Scheduling:

      • The operating system is responsible for scheduling processes on available CPUs or cores. This involves deciding which processes should run, when, and on which processor. Process scheduling is influenced by factors like priority, resource availability, and load balancing.
    4. Concurrency vs Parallelism:

      • Concurrency refers to the ability of the system to manage multiple processes (or threads) simultaneously, but not necessarily running at the same time.
      • Parallelism is a specific form of concurrency where multiple processes run simultaneously on multiple processors or cores, increasing throughput and performance.
    5. Process Synchronization:

      • Since processes are independent and often run concurrently, synchronization mechanisms are used to ensure that they operate correctly and do not interfere with each other in undesirable ways.
      • Synchronization can be achieved through IPC mechanisms like locks, semaphores, and barriers, which prevent race conditions and ensure coordinated execution.

    Characteristics of Process-Centric Programming

    1. Isolation:

      • Each process has its own memory space and execution environment. This isolation provides better fault tolerance since failure in one process does not directly affect others, unlike threads that share memory space within the same process.
    2. Heavyweight:

      • Processes are considered "heavyweight" compared to threads because they have more overhead. Each process requires its own resources, such as memory and file descriptors, and the OS must manage them independently.
    3. Communication Overhead:

      • Since processes do not share memory space, communication between processes (through IPC) generally has higher latency and overhead compared to thread-based communication (which can directly access shared memory).
    4. Fault Tolerance:

      • Because processes are isolated from each other, a failure in one process can often be contained without affecting other processes. This makes process-centric programming highly fault-tolerant, especially in distributed systems where processes may run on different machines.

    Programming Models for Process-Centric Programming

    1. Message Passing Interface (MPI):

      • MPI is a standardized and portable message-passing system used primarily in high-performance computing (HPC) environments. MPI allows processes to communicate by sending and receiving messages over a network, which is essential in distributed and parallel applications.
      • MPI provides tools to manage process communication and synchronization across clusters or grids of computers.

      Example (MPI in C):

      MPI_Init(&argc, &argv);
      MPI_Comm_rank(MPI_COMM_WORLD, &rank);
      MPI_Comm_size(MPI_COMM_WORLD, &size);
      
      // Each process sends a message to process 0
      if (rank != 0) {
          MPI_Send(&data, 1, MPI_INT, 0, 0, MPI_COMM_WORLD);
      } else {
          for (int i = 1; i < size; i++) {
              MPI_Recv(&data, 1, MPI_INT, i, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
          }
      }
      
      MPI_Finalize();
      
    2. Distributed Computing:

      • In distributed computing, process-centric programming is used to manage processes running on different machines in a network. Each machine runs one or more processes that communicate over a network, typically using message passing, RPC, or other network protocols.
      • Examples of distributed computing frameworks include Apache Hadoop, Apache Spark, and Google MapReduce, where different processes (running on different nodes) work together to solve a larger problem.
    3. Operating System Process Management:

      • Many modern operating systems, like Linux and Windows, use process-centric models for multitasking. In these systems, each running program is typically assigned its own process. The operating system handles the scheduling, management, and execution of these processes.
      • Technologies such as containers (e.g., Docker) and virtual machines abstract processes and their environments, creating isolated execution environments for each process.
    4. Actor Model:

      • The Actor Model is a concurrency model that treats "actors" as the fundamental units of computation. Each actor is a process that can receive messages, process them, and send messages to other actors. Actors are isolated and communicate solely through message passing.
      • Frameworks like Akka (in Scala and Java) are based on the Actor Model, where each actor is a process running in its own isolated environment.

    Advantages of Process-Centric Programming

    1. Fault Isolation:

      • Processes are isolated from each other, meaning that if one process crashes, it doesn't directly affect the others. This makes process-centric programming robust for fault tolerance in complex systems and distributed environments.
    2. Scalability:

      • Process-centric programming scales well in distributed systems. Each process can run on a different machine or node, enabling applications to scale horizontally by adding more machines to the system.
    3. Modularity:

      • By breaking a problem into independent processes, each responsible for a part of the computation, process-centric programming encourages modular designs. This modularity simplifies debugging, testing, and maintaining large systems.
    4. Security:

      • The isolation of processes ensures that malicious or buggy processes cannot easily corrupt others, providing better security and stability for multi-process applications, particularly in distributed environments.

    Challenges of Process-Centric Programming

    1. Higher Overhead:

      • Processes tend to be more resource-intensive than threads. They require separate memory space and resources, which can introduce significant overhead, especially when many processes are involved.
    2. Complex Communication:

      • Since processes do not share memory, they need to rely on message passing or other IPC mechanisms, which can be more complex to implement and introduce higher communication latency compared to thread-based models.
    3. Synchronization and Coordination:

      • While processes are isolated, when they need to communicate or synchronize, complex mechanisms are required to ensure data consistency and correct sequencing of operations.
    4. Difficulty in Managing State:

      • In distributed or multi-process environments, managing the state across processes can be challenging. Since processes are isolated, maintaining consistent states across all processes requires careful design and possibly additional mechanisms for state synchronization.

    Use Cases of Process-Centric Programming

    1. Distributed Systems:

      • In distributed systems, such as cloud computing environments, microservices architectures, or large-scale distributed databases, process-centric programming is used extensively to manage independent services or components that communicate over a network.
    2. High-Performance Computing (HPC):

      • HPC applications, like simulations and scientific computations, often rely on MPI or similar technologies to divide a task into independent processes running on different machines in a cluster.
    3. Fault-Tolerant Systems:

      • Process-centric programming is ideal for systems that require high fault tolerance. Each process can handle a portion of the workload independently, ensuring that if one process fails, it does not bring down the entire system.
    4. Multi-User Systems:

      • In multi-user environments, such as operating systems and web servers, processes allow the isolation of different user tasks, ensuring that one user's application does not interfere with another's.

    Conclusion

    Process-centric programming is a powerful paradigm for managing parallel and distributed computing tasks by organizing computations into independent processes. It is particularly useful in scenarios where isolation, fault tolerance, and scalability are important. While process-based models have higher overhead compared to thread-based programming, they provide better isolation and security, making them suitable for complex, large-scale systems. Challenges like communication complexity and synchronization must be carefully addressed, but with tools like MPI, message-passing, and operating system process management, process-centric programming remains a key strategy in building resilient and scalable applications.

    ← Previous topic 19
    Task parallel programming
    Next topic 21 →
    Shared memory programming

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    8mremaining
    1.4kwords
    Intermediatelevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Parallel & Distributed Computing