DC - Exp 1
DC - Exp 1
● Client-Server Applications: Clients may communicate with servers using sockets, RPCs,
or message queues.
● Multi-threaded Programs: Different threads within a process might use shared memory
or semaphores to communicate.
● Distributed Systems: Different nodes in a distributed system might use sockets, message
queues, or MOM to exchange information.
● Real-Time Systems: Using signals or semaphores for process synchronization in time-
sensitive applications.
Code:
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 7 10:24:01 2025
@author: student
"""
import multiprocessing
import time
# Define the sender function that will put messages into the queue
def sender(q):
# Simulate some work
time.sleep(2)
message = "Hello, introduction to distributed computing "
print(f"Sender is sending: {message}")
q.put(message) # Put the message into the queue
# Define the receiver function that will get messages from the queue
def receiver(q):
# Receive the message from the queue
message = q.get()
print(f"Receiver received: {message}")
Abbreviation Meaning
CC coordinating conjunction
CD cardinal digit
DT determiner
EX existential there
FW foreign word
IN preposition/subordinating conjunction
LS list market