From: Eric <eric@cisu.net>
To: linux-newbie@vger.kernel.org, linux-c-programming@vger.kernel.org
Subject: Multithreaded /sbin.init? Is it possible?
Date: Sun, 14 Sep 2003 12:40:55 -0500 [thread overview]
Message-ID: <200309141240.55800.eric@cisu.net> (raw)
Hello,
I have an interesting theory. I have beginning programming expereice and
would like the input of those that have more expereince than me. Please don't
flame if this is a waste of time. Rather I would like an open discussion on
the why's and why nots of this.
Wouldn't the Linux Boot process be speeded up if the init program was
multithreaded? I know a little about threads.. and I think there might be
some complication of PPID assignment coming from the threads which would
probably terminate instead of having a PPID of 1 which is init and will never
terminate. (i think?). Should init scripts have a parent PID of 1? Does this
even matter?
If I am correct, whenever a programs parent dies, its parent becomes init
anyways. So when the thread finishes execution of the script, then its parent
would become init just as if it had started sequentially and directly from
init.
The script links in /etc/rc.d/x.d/ would be grouped according to their S and
K numbers. That is, if you have 5 scripts that are S5, each would be given to
a thread to execute and there would be 5 threads. The init process would wait
for each thread to clean up before proceeding to the next group. I know this
would happen in an undefined order, but if you want, for example, DHCPD to
start after network then you would assing S5network and S6dhcpd. There would
still be a defined order for differently numbered scripts, just the bootup
process wouldnt have to wait for each script to terminate sequentially.
Each group would only take as long and the slowest script instead of the sum
of the execution time of the scripts. The init would start with the S1
scripts and maybe fork 3 times, wait for each to finish...., then fork maybe
twice for the S2 group if there are two scripts, wait for them to
finish...etc....
Is this even possible?
----------------------
Eric Bambach
Eric (at) CISU (dot) net
----------------------
next reply other threads:[~2003-09-14 17:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-14 17:40 Eric [this message]
2003-09-14 18:25 ` Multithreaded /sbin.init? Is it possible? Jan-Benedict Glaw
2003-09-14 18:59 ` Eric
2003-09-14 19:37 ` Jan-Benedict Glaw
2003-09-14 18:59 ` Eric
2003-09-14 19:45 ` Jan-Benedict Glaw
2003-09-15 10:29 ` szonyi calin
2003-09-15 16:49 ` Tabris
2003-09-23 6:12 ` Nico Schottelius
2003-09-15 18:13 ` [resend] " Tabris
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=200309141240.55800.eric@cisu.net \
--to=eric@cisu.net \
--cc=linux-c-programming@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).