Dear Aqua Interface Programmers,
I asked earlier if any significant work had been done on the
TCL/MacOS
socket handling between 8.4.10 and 8.4.13. From the silence,
I assume not.
Nevertheless, Wish 8.4.12 freezes when we move windows
around during
TCPIP data transfer, while 8.4.11 does not. I'd like to
know if this is
a MacOS interface problem, or a core TCL problem. If it's a
core TCL
problem, I'll take it to another forum.
Here's how to reproduce the freeze and prove to yourself
that it's a
problem with the TCL/TK version. You'll need two copies of
Wish. One
should be 8.4.11 or earlier. The other should be 8.4.12 or
later.
Start the <=8.4.11 Wish. Open the console. Paste the
following server
accept procedure:
proc accept {sock addr port} {
puts "Accepted $sock from $addr\:$port"
fconfigure $sock -blocking 0 -translation binary
for {set i 0} {$i < 1000} {incr i} {
puts -nonewline $sock "0000000000"
after 10
update
}
close $sock
puts "Closed $sock from $addr\:$port"
}
Start the server socket with:
set sock [socket -server accept 2000]
Start the >=8.4.12 Wish. Open the console. Paste the
following client
procedure:
proc getblock {} {
set sock [socket 0.0.0.0 2000]
fconfigure $sock -blocking 0 -translation binary
set bytes_remaining 10000
fileevent $sock r [list set timeoutvar
"Reading."]
while {$bytes_remaining > 0} {
if {$bytes_remaining > 0} {vwait timeoutvar}
set data [read $sock $bytes_remaining]
set bytes_remaining [expr $bytes_remaining - [string
length $data]]
}
close $sock
}
Now type "getblock" in the console. The client
starts to download data
from the server. The data comes in at 10 bytes every 10 ms,
taking a
total of 10 seconds. If you don't touch the client, the
transfer will
complete.
Type "getblock" again. Move the console or
master window on the client
side (Wish version >=8.4.12) with the mouse. Move it
again and again,
each time grabbing it and releasing it. After half a dozen
mouse-clicks,
the client freezes. Check the MacOS system Console (Console
Utility).
There is no error report. The client freezes, but it does
not crash.
If you quit both the client and server Wish programs, and
repeat the
experiment with <=8.4.11 as the client, you'll find that
you can move
the windows around as much as you like during data transfer,
and it
never freezes. In all cases, you can move the window on the
server side
around and it never freezes.
If you experiment with the getblock procedure, you'll find
that the
freeze occurs during "vwait". The freeze occurs
only if the socket is
open, free of errors, and data is coming in.
I compiled my own copies of 8.4.10, 8.4.11, 8.4.12, and
8.4.13 on a G4
and Single-Intel mac running OS 10.4.7. I also downloaded
pre-compiled
PPC copies of 8.4.5 and 8.4.10. I performed the above
experiments on
both machines with all versions. On the Intel machine, the
PPC copies
ran with Rosetta. Any client 8.4.12 or later freezes on both
machines.
Any client 8.4.11 or earlier is robust on both machines.
Note: From what I gather, <=8.4.12 is not guaranteed to
work when
compiled for Intel. That may be so, and these versions do
mess up colors
in Tk_PutPhotoBlock. But they compile and they almost work.
Note: No version of PPC Wish will run on our Dual-Intel mac,
but they
all work on our Single-Intel mac. I'm investigating.
Yours, Kevan
--
Kevan Hashemi, Electrical Engineer
Physics Department, Brandeis University
http://alignment.h
ep.brandeis.edu/
------------------------------------------------------------
-------------
Using Tomcat but need to do more? Need to support web
services, security?
Get stuff done quickly with pre-integrated technology to
make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on
Apache Geronimo
http://sel.as-us.falkag.net/
sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Tcl-mac mailing list
tcl-mac lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcl-mac
|