From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,87a9e6f2526ba20c X-Google-Attributes: gidfee84,public From: greg_nate@my-deja.com Subject: Re: Please help Date: 2000/04/07 Message-ID: <8cl3s9$hq$1@nnrp1.deja.com>#1/1 X-Deja-AN: 607939339 References: <38EE00C8.A8BDBD47@informix.com> X-Http-Proxy: 1.0 x35.deja.com:80 (Squid/1.1.22) for client 12.15.16.10 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Fri Apr 07 16:54:40 2000 GMT X-MyDeja-Info: XMYDJUIDgreg_nate Newsgroups: comp.unix.osf.osf1 X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT) 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 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.