On Wednesday 25 July 2007, Seb wrote:
> "Roberto A. Foglietta" <[EMAIL PROTECTED]> a écrit:
> >  sorry for the OT but I am wondering if it would be better have three
> > indipendent script which runs concurrently or it is better having only
> > a script like this:
>
> Theorically 3 scripts = 3 shells = 3 system calls.

you cant equate 3 shells to 3 system calls ... simply executing `bash` will 
execute many more system calls than just one.

> So, IMHO the most 
> efficient must be to launch one script. After, it depends on the code
> you execute : if there are many system calls and few needs in memory,
> you probably won't see the difference.

since each script is really just /bin/bash (or whatever), the appropriate 
sections are shared in memory automatically.  an independent script is pretty 
much the same as backgrounding something as the shell will fork a new process 
for each one.  so you still have 3 processes.

about the only thing you could say is how long running is the script.  if it 
is long running, then the difference will probably be negligible.  if it's 
something that gets executed over and over, spawning subshells may be 
slightly cheaper than forking whole new shells for each script.  but really, 
this is all just conjecture ... the only real test is one you run yourself 
and gather quantitative data about resource utilization.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to