Operating System-Unix [3i Infotech Placement]: Sample Questions 66 - 67 of 78

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 66

Edit

Describe in Detail

Essay▾

How do you create special files like named pipes and device files?

Explanation

  • Special files are created by the system call ‘mknod’ .
  • Special file is created using following steps:
    • New inode is assigned by kernel.
    • Sets the file type as a pipe, directory or special file.
    • If the file type is a device file, major and minor device numbers are the two entries created.
  • Using the mknod command, special files are created:
    • mknod [options] name type [major minor] .
  • Example:
    • For a disk, disk controller is the major device number and the disk is the minor device.
  • Unix example:
    • $ mknod < pipe name > p

Question 67

Edit

Describe in Detail

Essay▾

What is IPC? What are the various schemes available?

Explanation

Inter Process Communication
  • The term IPC or interprocess communication describes various ways by which different process running on some operating system communicate between each other.
  • Various schemes available are as follows:
  • Pipes:
    • One-way communication scheme through which different process can communicate.
    • The problem is that the two processes should have a common ancestor.
    • This problem was fixed with the introduction of named-pipes.
  • Message Queues:
    • Message queue can used between related and unrelated processes running on a machine.
  • Shared memory:
    • This is the fasted of all IPC schemes.
    • The memory to share is mapped into the address space of the processes.
    • The speed achieved is attributed to the fact that there is no kernel involvement.
    • This scheme needs synchronization- like mutexes, condition-variables, read-write locks, record-locks, and semaphores.

Developed by: