that can be avoided, that does not happen because it
>> >> would've already been copied before exec() in the child gets a chance
>> >> to execute.. the fork system call calls do_fork somewhere which calls
>> >> copy_process which does this copying so it ca
On Mon, 2010-01-11 at 15:01 +0530, Pete wrote:
> After going through this thread, I just tried out the following simple
> code:
>
> int main (void) {
>
> int pid;
>
> int *testVar = (int *) malloc (sizeof (int));
>
> *testVar = 10;
>
> printf ("%d [%d] Main \n", *testVar, testVar);
>
> pid=
ould've already been copied before exec() in the child gets a chance
> >> to execute.. the fork system call calls do_fork somewhere which calls
> >> copy_process which does this copying so it can't be avoided in any
> >> case. The book says copy-on-write itself h
that does not happen because it
>> would've already been copied before exec() in the child gets a chance
>> to execute.. the fork system call calls do_fork somewhere which calls
>> copy_process which does this copying so it can't be avoided in any
>> case. The bo
>
> Hi Joel...
>
> Manish is right. Please notice that he talked about "why do we do copy
> on write (COW) if soon after child is forked, it quickly does exec()".
> So yes, COW has overhead, but imagine if parent ran first. COW will be
> triggered for parent address
tem call calls do_fork somewhere which calls
> copy_process which does this copying so it can't be avoided in any
> case. The book says copy-on-write itself has more overhead that is
> avoided with exec() in the child, but I'm trying to figure how.
>
> -Joel
Hi Joel...
Mani
which does this copying so it can't be avoided in any
case. The book says copy-on-write itself has more overhead that is
avoided with exec() in the child, but I'm trying to figure how.
-Joel
On Mon, Jan 11, 2010 at 12:18 AM, Manish Katiyar wrote:
> On Mon, Jan 11, 2010 at 12:02 AM
>> How does running exec() in child more efficient than having
>> copy-on-write trigger in the parent?
>
> In order to create a new process (fork), you will copy the whole of
> relevant info of address space from the parent. Now if the address
> space is shared and parent r
gt; system call.
>
> Quoting Pg 32 (2nd edition):
> "In do_fork() the child is woken up and run. Deliberately the kernel
> runs the child process first. In the common case of the child simply
> calling exec() immediately, this eliminates any copy-on-write overhead
> that would occur if
d run. Deliberately the kernel
runs the child process first. In the common case of the child simply
calling exec() immediately, this eliminates any copy-on-write overhead
that would occur if the parent ran first and began writing to the
address space"
How does running exec() in child more effi
On 22:30 Thu 07 Feb 2008, Mulyadi Santosa wrote:
> On Feb 6, 2008 12:49 PM, Rick Brown <[EMAIL PROTECTED]> wrote:
> > So in linux, is a child run first or the parent? Can we rely on this
> > information?
>
> Hm, this might be the answer:
> http://lxr.linux.no/linux/kernel/sched.c#L1663
>
> it say
Hi
On Feb 6, 2008 12:49 PM, Rick Brown <[EMAIL PROTECTED]> wrote:
> So in linux, is a child run first or the parent? Can we rely on this
> information?
Hm, this might be the answer:
http://lxr.linux.no/linux/kernel/sched.c#L1663
it says:
unsigned int __read_mostly sysctl_sched_child_runs_fir
Hi,
I had read that the operating systems that use copy-on-write mechanism
for fork(), it is better if they deliberately allow the CHILD to run
first.
This would be better because in 99% of the cases child will call
exec() and the new address space will be allocated. Instead if the
parent is
Hi,
>>
>> I had read that the operating systems that use copy-on-write
>> mechanism for fork(), it is better if they deliberately allow the
>> CHILD to run first.
>>
>> This would be better because in 99% of the cases child will call
>> exec() a
On Feb 6, 2008 6:03 PM, Rajat Jain <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> >>
> >> I had read that the operating systems that use copy-on-write
> >> mechanism for fork(), it is better if they deliberately allow the
> >> CHILD to run first.
> &g
On Feb 6, 2008 11:19 AM, Rick Brown <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I had read that the operating systems that use copy-on-write mechanism
> for fork(), it is better if they deliberately allow the CHILD to run
> first.
>
> This would be better because in 99% o
16 matches
Mail list logo