[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Q about do_fork()




----- Original Message -----
From: John Levon <moz@compsoc.man.ac.uk>
To: petur thors <peturth@hi.is>
Cc: <kernelnewbies@nl.linux.org>
Sent: Friday, April 06, 2001 3:21 PM
Subject: Re: Q about do_fork()


> On Fri, 6 Apr 2001, petur thors wrote:
>
> > Hi
> > I was wondering. If you are on an SMP machine and two diffirent
processes do
> > a fork() or a clone() system call at the same time, can the
corresponding
> > kernel control paths enter the do_fork fuction in kernel/fork.c at the
same
> > time or is one locked out while the other does his thing. I would be
very
> > happy if someone could give me a hint.
> > Many, many thanks

John Levon wrote:

> I can't see any locks around do_fork(). You can look yourself, in the file
arch/i386/process.c
>
> I also can't see (looking quickly) any problem with the routine being
multi-threaded
>
> john
>
> --
> "I am a conscientious man, when I throw rocks at seabirds I leave no tern
> unstoned."
>    - Ogden Nash

Yes, thanks. But then there must be? a lock of some kind in
alloc_task_struct
in do_fork().Right? Two processes canīt allocate free page frames (8kb
task_union) at the exact same moment.(please correct me if iīm wrong).
Mucho thanks

-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/