"Austad, Jay" <austad at marketwatch.com> wrote:
> 
> Does anyone know if there is a way to make a program start faster?  I'm
> constantly spawning off some processes, and they are taking about 150ms
> to start.  I need to get that down to about 50ms so the server can keep
> up.

I think the kernel probably already has facilities by which you can speed
things up, though they probably require some different programming
practices.  If you're talking about some closed-source program, or
something that's just too big to mess with, these ideas probably aren't
the greatest..

If you don't have to load new processes, don't.  While lots of services
seem to be of the spawn-serve-die variety (spawned on a new connection,
serve the data, terminate), I don't think there would be a problem if the
daemon could be more persistent and keep running after a connection has
terminated, staying ready for new connections.  New processes would only
have to be spawned if all of the current ones were busy.

There's also the possibility of using threads instead of separate
processes.  I've heard that the cost of spawning a new thread on Linux is
not a whole lot more than that of making a library function call. 
Programming with threads can be confusing, though..

-- 
 _  _  _  _ _  ___    _ _  _  ___ _ _  __   I lost a button hole 
/ \/ \(_)| ' // ._\  / - \(_)/ ./| ' /(__   today. 
\_||_/|_||_|_\\___/  \_-_/|_|\__\|_|_\ __)                             
[ Mike Hicks | http://umn.edu/~hick0088/ | mailto:hick0088 at tc.umn.edu ]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://shadowknight.real-time.com/pipermail/tclug-list/attachments/20011024/3ad30c57/attachment.pgp