Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

tcl 8.4.12 spin loop

6 views
Skip to first unread message

Mary Lei

unread,
Sep 19, 2006, 7:34:14 PM9/19/06
to
We are running 64 bit tclsh 8.4.12 on Solaris 10 sparc machine
and have some C++ libraries loaded
as packages. We compile tclsh with threads disabled
as we do not use the tcl thread package.

Sometimes after loading up the system
with a lot of job processing (open, close socket and returning
reply to client sockets), we found tclsh to
be in some heavy spin loop where
it is polling (calling pollsys)
all the time. cpu usage jumps from 10% to 45%.
A lot of memset and memcpy calls are also bing made.

Has anyone seen this kind of spin loop ?

Mary Lei

unread,
Oct 4, 2006, 7:56:09 PM10/4/06
to Mary Lei

More detailed analysis with gdb shows that
TcpOutputProc is repeated being called
to write out data to a socket that may not exist
resulting in errno of EWOULDBLOCK.
And somehow tcl keeps trying to output the data.

If we use the "socket $host $port"
option instead of "socket -async $host $port"
the problem is not seen.

0 new messages