Re: system() peformance ..
On Wed, 25 Jun 2003 17:41:31 +0530, Paras Sharma <firstname.lastname@example.org>
wrote in comp.lang.c:
> I am running a cpp process say "ABC" which uses system() function .
> inside system running an one external binary say "xyz" (program ) ;
If by "cpp process" you mean a program written in C++, you are
off-topic posting in comp.lang.c at all.
> [This external program (xyz) takes some parameter do process & print
> some output.. meaning comsumes a bit of time . ]
> Now, my question is how to get the maximum rate
Neither C nor C++ have "maximum rates". Neither language defines,
specifies, or guarantees how long any particular code takes to
> 1 I tried giving system("xyz & " ) ; /////.. run external program in
> the background ; this will make return of system .
While the system() function is completely standard in C and C++, the
results are completely implementation-defined. That is both as to
what it does and how long it takes.
> Getting execution rate ~ 25 sec
> 2 I tried giving system("xyz " ) ; meaning .. run external program
> in the background ; this will make return of system .
> Getting execution rate ~ 14 sec
> 3 I tried running many instances of ABC .. now execution rate got
> decreased to ~15 per process
Neither C nor C++ have anything called a process.
> I tried using vfork , ..execl .. but some how system gives the better
> response and easy way out .. ..
> Main overservation is - System comsumes lot of time .. ( even running
> with root )
These terms are not defined in either C or C++: vfork, ..excel, root.
> Now My quiestion is ... how to increase the performace of the system()
> so that for different calling of system is fast ..
> Is it possibleto do such thing throught programming or configuration file
I imagine that the system() function call itself takes a few
microseconds, and it is unlikely that it can be speeded up much.
As for the execution time of whatever your operating system happens to
do with the string that you pass to it is not a language issue at all.
> Thanks in advance
This is not a language issue at all. Ask in a group devoted to your
operating system. Perhaps news:comp.unix.programmer.
|All times are GMT. The time now is 07:24 AM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.