Re: fork and exec

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

 



i can see that there are not many specific questions here....just
asking "why".....and speaking of concepts...

personally...i think knowing WHY things are done the way it is done is
more impt than knowing the details of HOW....but then it is chicken
and egg...until u know how they are done....then u began to ask
WHY....once u understood that.....design your own ideas based on new
understanding...

but life is a game of probability.....so probabilistically...i think u
will gain more and contribute more if u trying understanding HOW AND
WHY things are done concurrently....while at the same fallback on
design your own ideas once in a while.....

i can summarize a few key FEATURES or PROBLEMS u must have / solved,
in multiprocessor/multi-users/multiprocess user/process management
system (as for the current design....i really wish u or someone else
will overhaul the entire design of UNIX.....):

a.   u don't want them to step on each other's memory.....which is one
of the hidden reason for separation of memory space during forking...

b.   after forking...different process is will be protected via INTEL
CPU HARDWARE feature.....there are many....and u have to design the OS
to follow all these hardware features...(one of them is MMU, then task
register, context switching, memory page attributes protection etc)

c.  efficiency of execution....minimization of resources
(copy-on-write design)...performance tradeoff between harddisk storage
vs memory storage....(swapping)....

Generally the field is huge....and endless argument ....and I have to
stop here....

PS:   Get hold of "The Magic Garden Explained".....my all-time
favorite on OS design..

On Sun, May 25, 2008 at 1:05 AM, William Case <billlinux@xxxxxxxxxx> wrote:
> Hi Peter;
>
> On Sat, 2008-05-24 at 23:34 +0800, Peter Teoh wrote:
>> On Sat, May 24, 2008 at 11:31 PM, Peter Teoh <htmldeveloper@xxxxxxxxx> wrote:
>> > Sent on behalf of William Case:
>> >
>> > From: William Case <billlinux@xxxxxxxxxx>
>> > Date: Sat, May 24, 2008 at 11:26 PM
>> > Subject: fork and exec
>> >
>> > Hi;
>> >
>> > I have a fundamental question about why Linux/Unix uses the parent and
>> > child modal to start and run new processes.
>> >
>> >
> [snip]
>
>
>> > My question is:  Why did the original designers of Multics/Unix choose
>> > to use the forking modal to start a new processes?  Do not other OSs use
>> > other modals?  What problem(s) did the fork overcome?  Couldn't a system
>> > have been designed that just (in some way) starts each process raw?
>>
>> can u elaborate what is meant by "RAW"??
>>
> I was using the word "raw" simply as a metaphor for a process that is
> directly placed in memory and accessed without first copying a parent or
> being overlaid on a space (buffer) created by a child.
>
> Two possibilities come to mind:
>
> 1) Starting a process the same way that PID 0 (swap ??) is started, or,
> 2) Starting a process the way that other Operating Systems start a
> process.
>
> In 2) above, I don't know how other OSes might start their processes but
> everything I have read about Unix related systems *implies* that the
> parent-child relationship is unique to or central to *nixes.  I.e other
> OSes must be doing it differently.
>
>
>> I like new ideas....please elaborate....things necessarily have to be
>> different all the time.....that's how Windows can survive in
>> business....
>>
>> > Intuitively, copying a process then overwriting it seems wasteful or at
>> > least inelegant, so why is it needed?  How does a parent-to-child
>> > process enhance its (*nix's) design philosophy?
>> >
>> > Since forking is at the very core of the kernel, I would like to
>> > understand intellectually why the fork process is necessary?
>> >
> Once again, I am not asking how it is done.  I am asking why.  Is the
> parent-child relationship used because there is, in fact, no other way
> to do it?  If so why does the claim seem to be made that parent-child
> processing is unique to *nixes?
>
>> > I am not being argumentative, or trolling, or proposing something
>> > different or better.  Although relatively new to kernel programming and
>> > 'C' I am not a complete newbie.  I would just like to see in my
>> > minds-eye what is going on and *why*.
>> >
>> > --
>> > Regards Bill
>> >
> As I read various manuals, read books on the Linux Kernel source code,
> and prepare my machine for a virtual Linux system that I can explore and
> play with. This fork question, WHY?, keeps niggling at me and in some
> ways makes it harder for me to concentrate on the longer view of what is
> happening in the kernel.
>
> --
> Regards Bill
>
>



-- 
Regards,
Peter Teoh

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux