All Exams Test series for 1 year @ ₹349 only
Question

In UNIX, which system call is used for inter process communication via shared memory ?

The correct answer is
shmget()

UNIX Shared Memory IPC: Using shmget()

Inter-Process Communication (IPC) allows different processes to exchange data. Shared memory is an efficient IPC method where processes can access a common region of memory.

System Call Analysis for Shared Memory

The question asks for the UNIX system call specifically used for creating or accessing shared memory segments.

  • pipe(): This system call creates a unidirectional data stream (a pipe) between processes. It's used for stream-based communication, not direct memory access.
  • msgget(): This system call is used with message queues. It retrieves a message queue identifier, facilitating message-based IPC, not shared memory.
  • shmget(): This system call is used to obtain a shared memory identifier. It either creates a new shared memory segment or returns the identifier of an existing one based on the provided key. This is the primary system call for managing shared memory segments.
  • semctl(): This system call performs control operations on semaphores. Semaphores are often used to synchronize access to shared resources (like shared memory), but $semctl()$ itself doesn't manage the shared memory segment.

Therefore, $shmget()$ is the correct system call for initiating shared memory inter-process communication in UNIX.

Was this answer helpful?

Important Questions from Miscellaneous

  1. Which of the following relationships is/are not true?
    (A). Most probable velocity = $\sqrt{\frac{2RT}{M}}$
    (B). PV = $\frac{3}{2}kT$
    (C). Compressibility factor Z = $\frac{pV}{nRT}$
    (D). Average kinetic energy of gas = $\frac{1}{2}kT$
    Choose the correct answer from the options given below
  2. Match List-I with List-II
    List-IList-II
    Electronic ConfigurationFirst Ionisation energy (kJ mol$^{-1}$)
    (A). ns$^2$(I). 2100
    (B). ns$^2$np$^1$(II). 1400
    (C). ns$^2$np$^3$(III). 800
    (D). ns$^2$np$^6$(IV). 900

    Choose the correct answer from the options given below:
  3. The shielding constant of a 2p electron (calculated using Slater's rules) is
  4. Match List-I with List-II
    List-IList-II
    SpectroscopyProperty
    (A). Raman(I). Polarizability
    (B). FTIR(II). Dipole Moment
    (C). UV-Visible(III). Absorbance
    (D). NMR(IV). Spin

    Choose the correct answer from the options given below:
  5. The structure of protein comprises of:
    (A). Primary structure of protein is associated with amino acids
    (B). Secondary structure of protein is associated to peptides
    (C). Tertiary structure of protein is associated with polypeptide chains
    (D). Quaternary structure of protein is associated with polypeptide chains
    Choose the correct answer from the options given below:
Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App