Unix
Unix
FORK() VFORK()
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.
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()