public inbox for linux-newbie@vger.kernel.org
 help / color / mirror / Atom feed
From: Jim Nelson <james4765@verizon.net>
To: Jagadeesh Bhaskar P <jbhaskar@hclinsys.com>
Cc: Linux Newbie <linux-newbie@vger.kernel.org>
Subject: Re: Query regarding Copy-on-write
Date: Sat, 20 Nov 2004 09:17:32 -0500	[thread overview]
Message-ID: <419F51FC.2030101@verizon.net> (raw)
In-Reply-To: <1100947162.4038.43.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?
> 
> How can this work? Can someone please help me on this regard?
> 
> 

Standard *nix forking does not allow that kind of interaction between the data of 
parent and child processes.  Pipes are designed for that kind of interprocess 
communication.

POSIX threads do run in the same address space - it requires a bit more 
programming effort, but it seems to fit what you're asking for a little better.

http://www.cs.nmsu.edu/~jcook/Tools/pthreads/pthreads.html

Is a decent overview on pthreads.  I haven't used them - nothing I've written 
needed that kind of interactivity.

Not every computer system can run pthreads on Linux - i686 or higher, SPARC, and 
SPARC64 are the only ones I *know* have pthreads working (i. e. I own the machine 
and pthreaded Linux apps work on them).  i586 and earlier PC's lack some 
fundamental capabilities necessary to make threading work.

Anyone else care to take it from here?

Jim
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

      parent reply	other threads:[~2004-11-20 14:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-20 10:39 Query regarding Copy-on-write Jagadeesh Bhaskar P
2004-11-20 13:59 ` Simon Valiquette
2004-11-20 14:22   ` Jim Nelson
2004-11-22  3:34   ` Jagadeesh Bhaskar P
2004-11-22  6:31     ` Simon Valiquette
2004-11-22  6:49       ` Jagadeesh Bhaskar P
2004-11-22 11:48         ` Simon Valiquette
2004-11-23  4:00           ` Manish Regmi
2004-11-20 14:17 ` Jim Nelson [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=419F51FC.2030101@verizon.net \
    --to=james4765@verizon.net \
    --cc=jbhaskar@hclinsys.com \
    --cc=linux-newbie@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