Why does the Front End freeze when using a TCPIP-mode connection with the kernel?

To: mathgroup at smc.vnet.net

Subject: [mg123987] Why does the Front End freeze when using a TCPIP-mode connection with the kernel?

From: Szabolcs Horvát <szhorvat at gmail.com>

Date: Wed, 4 Jan 2012 05:01:45 -0500 (EST)

Delivered-to: l-mathgroup@mail-archive0.wolfram.com

Note: I already asked this question here, but I'm hoping to reach a
larger audience:
http://stackoverflow.com/questions/8717211/understanding-kernel-frontend-communication-why-does-my-front-end-freeze
The question:
When I try to connect to a remote kernel, the front end always freezes
sooner or later. I managed to reproduce the problem on the *local*
machine. Can you please take a look at what I am doing wrong, and how I
can prevent the problem?
Here's how to reproduce the problem on a single machine (no remote
connection needed):
1. Create a new kernel configuration (Evaluation menu -> Kernel
Configuration Options...)
Select Advanced Options.
Arguments to MLOpen:
-LinkName "8000@YOUR-IP-HERE" -LinkMode Listen
-LinkProtocol TCPIP -LinkHost "YOUR-IP-HERE"
-LinkOptions MLDontInteract
(Replace YOUR-IP-HERE with your computers IP address. On Windows
you can get this by typing ipconfig in a command window.)
Shell command to launch kernel: leave empty (we will do it manually)
2. Open a new notebook, set the notebook's kernel to the one you
just set up, and evaluate something (1+1).
3. Now we need to launch the kernel manually, before the connection
times out (do it quickly). So start a new kernel (math) in command line
mode, and evaluate the following:
link==LinkConnect["8000",LinkProtocol->"TCPIP"] (* connect to front
end link *)
$ParentLink == link (* set the front end link as parent link *)
Now the connection is established, and everything appears to work
correctly (save for the one message in the front end's pink message window)
4. Evaluate Manipulate[n, {n, 0, 100, 1}]. This appears to work too.
Now play with the slider. Sooner or later the front end will freeze and
needs to be killed. For me, dragging the slider up and down for ~10
seconds without releasing it always suffices.
Why does the Front End freeze? How can I create a TCPIP-mode connection
between the front end and the kernel in a way that everything will be
working correctly?
Note: I am on Windows XP. I should also link to this presentation and
package here: http://library.wolfram.com/infocenter/Conferences/7250/
When I use this package, I get the same freeze.
--
Szabolcs Horv=E1t
Mma QA site proposal: http://area51.stackexchange.com/proposals/37304