From: greg_nate@my-deja.com
Subject: Re: Please help
Date: 2000/04/07 [thread overview]
Message-ID: <8cl3s9$hq$1@nnrp1.deja.com> (raw)
In-Reply-To: 38EE00C8.A8BDBD47@informix.com
I may be way off here, but it looks like the second call actually
creates another shell, by having it in the "()"....I haven't tested
this, so I don't know for sure....more experience C programmers ought
to know for sure.
I do know that the system call forks a shell, which is overhead in
itself, but like I said, I also think that the includeion of "()"
causes another shell to fork....
but an 8 second overhead? that's an awful lot...
dunno if this helps, but may give something to think about.
greg nate
In article <38EE00C8.A8BDBD47@informix.com>,
Rakesh Didwania <didwania@informix.com> wrote:
> Hi,
>
> Here is a simple C program:
>
> void f(void);
> main()
> {
> f();
> f();
> f();
> f();
> f();
> }
>
> void f(void)
> {
> system("time abc");
> }
>
> 'abc' is a big executable of size around 2MB.
> The output of the program is:
>
> real 1.7
> user 1.6
> sys 0.0
>
> real 1.8
> user 1.6
> sys 0.0
>
> real 1.7
> user 1.6
> sys 0.0
>
> real 1.7
> user 1.6
> sys 0.0
>
> real 1.7
> user 1.6
> sys 0.0
>
> However, if I change f() to
>
> void f(void)
> {
> system("(time abc) &");
> }
>
> The output is then :
>
> real 8.6
> user 1.7
> sys 0.0
>
> real 8.6
> user 1.7
> sys 0.0
>
> real 8.6
> user 1.7
> sys 0.0
>
> real 8.2
> user 1.7
> sys 0.0
>
> real 8.5
> user 1.7
> sys 0.0
>
> These tests are done on 4.0e DEC. Can anyone explain me the reason
> why the real time is so high when I run the test in background? One
> reason for this may be that the jobs in background may run at a low
> priority. But the interesting thing is that the real time is very
> low in 4.0d DEC almost about 6-8 times less. Is anything changed
> from 4.0d to 4.0e? Any help would be highly appreciated.
>
> Best Regards,
> Rakesh.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
next prev parent reply other threads:[~2000-04-07 4:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-04-07 4:00 Please help Rakesh Didwania
2000-04-07 4:00 ` greg_nate [this message]
-- strict thread matches above, loose matches on Subject: below --
1996-09-29 4:00 please HELP SHULA GOREN
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox