Menu

#1 Cpu Intensive

open
nobody
None
5
2004-03-17
2004-03-17
Anonymous
No

Once a connection is opened and subjected to a
continuous wait for requests on the connection the
application becomes really Cpu intensive hogging most
of the Cpu time.
The reason behind this is the infinite loop where the
input stream from the connection is checked for
readiness and presence of new data/commands.

I believe the reason behind this is so that the connection
is not locked up on a read.

A better way would possibly be to get the
listening wrapped up into a thread, which can then
wait on the input stream for new data as and when it
comes and then invoke the listeners.

The connection can free itself up for further invocations
from the main thread utilizing it and can kill the
waiting listener thread when asked to disconnect or
quit.

Since the listener thread waits on the stream to
interrupt it, the application will not be that cpu intensive.

Pls let me know what you think of this.

Also, a couple of initial problems I encountered trying to
get this up was that the perl5 pool util factories are not
initialized with perl5 util pools thereby resulting in the
command parser not being able to parse any command.

This requires the app to actually build the pool, which
is not really an appealling proposal.

Regards,
Krishna.

krishna_kumar_n@yahoo.com

Discussion


Log in to post a comment.