From: Bill Davidsen <davidsen@tmr.com>
To: Jagadeesh Bhaskar P <jbhaskar@hclinsys.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: on the concept of COW
Date: Mon, 22 Nov 2004 15:44:34 -0500 [thread overview]
Message-ID: <41A24FB2.4010909@tmr.com> (raw)
In-Reply-To: <1100947100.4038.41.camel@myLinux>
Jagadeesh Bhaskar P wrote:
> Hi,
>
> When a process forks, every resource of the parent, including the
> virtual memory is copied to the child process. The copying of VM uses
> copy-on-write(COW). I know that COW comes when a write request comes,
> and then the copy is made. Now my query follows:
>
> How will the copy be distributed. Whether giving the child process a new
> copy of VM be permanent or whether they will be merged anywhere? And
> shouldn't the operations/updations by one process be visible to the
> other which inherited the copy of the same VM?
The copies are separate and distinct, and the whole concept of the fork
is to have an independent process. Operations are (deliberately) not
visible from one process to another, that need can be met by the
shmget/shmat system calls (share on swap), mmap call (share on
filesystem), or by just using threads instead of fork. There may be
performance hits one way or the other, on large systems swap may be
faster than a filesystem, particularly /tmp if you use that.
>
> How can this work? Can someone please help me on this regard?
>
Man pages on shmget and mmap will get you started.
--
-bill davidsen (davidsen@tmr.com)
"The secret to procrastination is to put things off until the
last possible moment - but no longer" -me
prev parent reply other threads:[~2004-11-23 3:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-20 10:38 on the concept of COW Jagadeesh Bhaskar P
2004-11-20 11:39 ` Antonio Vargas
2004-11-22 7:35 ` Helge Hafting
2004-11-22 20:44 ` Bill Davidsen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41A24FB2.4010909@tmr.com \
--to=davidsen@tmr.com \
--cc=jbhaskar@hclinsys.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox