You are on page 1of 2

S.No.

FORK() VFORK()

While in vfork() system call, child and


In fork() system call, child and parent parent process share same address
1. process have separate memory space. space.

The child process and parent process gets Once child process is executed then
2. executed simultaneously. parent process starts its execution.

The fork() system call uses copy-on-write While vfork() system call does not use
3. as an alternative. copy-on-write.

Child process does not suspend parent Child process suspends parent process
4. process execution in fork() system call. execution in vfork() system call.

Page of one process is not affected by Page of one process is affected by page
5. page of other process. of other process.

6. fork() system call is more used. vfork() system call is less used.

7. There is wastage of address space. There is no wastage of address space.

If child process alters page in address If child process alters page in address
8. space, it is invisible to parent process. space, it is visible to parent process.

A message queue is a linked list of messages stored within the kernel and
identified by a message queue identifier
. A new queue is created or an existing queue opened by msgget(). 
New messages are added to the end of a queue by msgsnd().
Every message has a positive long integer type field, a non-negative length,
and the actual data bytes (corresponding to the length), all of which are
specified to msgsnd() when the message is added to a queue.
Messages are fetched from a queue by msgrcv().
We don’t have to fetch the messages in a first-in, first-out order. Instead, we
can fetch messages based on their type field.
All processes can exchange information through access to a common
system message queue.
The sending process places a message (via some (OS) message-passing
module) onto a queue which can be read by another process.
Each message is given an identification or type so that processes can select
the appropriate message.
Process must share a common key in order to gain access to the queue in
the first place.
sigprocmask() 

The sigprocmask() function examines, or changes, or both examines and changes the signal


mask of the calling thread.
The signals SIGKILL or SIGStop cannot be blocked. Any attempt to use sigprocmask() to
block these signals is simply ignored, and no error is returned.
SIGFPE, SIGILL, and SIGSEGV signals that are not artificially generated
by kill() or raise() (that is, were generated by the system as a result of a hardware or software
exception) are not blocked.
If there are any pending unblocked signals after sigprocmask() has changed the signal mask,
at least one of those signals is delivered to the thread before sigprocmask() returns.
If sigprocmask() fails, the process's signal mask is not changed.

Popoe \n and close


The popen() function executes the command specified by the string command.
The advantage of using popen and pclose is that the interface is much simpler
and easier to us

. The pclose() function closes a stream that was opened by popen(

You might also like