diff --git a/tests/ChangeLog b/tests/ChangeLog
index 93be155..d3dd34d 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,9 @@
+2004-05-19 Paul Jakma <paul@dishone.st>
+
+	* heavy.c: test programme to show how long-running functions
+	  kill responsiveness. Demonstrating the most niggly problem 
+	  left in bgpd.
+
 2004-05-13 Paul Jakma <paul@dishone.st>
 
 	* test-buffer.c: Andrew's buffer tester
diff --git a/tests/heavy.c b/tests/heavy.c
new file mode 100644
index 0000000..92ec65a
--- /dev/null
+++ b/tests/heavy.c
@@ -0,0 +1,225 @@
+/*
+ * $Id: heavy.c,v 1.1 2005/04/19 21:28:36 paul Exp $
+ *
+ * This file is part of Quagga.
+ *
+ * Quagga is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * Quagga is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Quagga; see the file COPYING.  If not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+/* This programme shows the effects of 'heavy' long-running functions
+ * on the cooperative threading model.
+ *
+ * Run it with a config file containing 'password whatever', telnet to it
+ * (it defaults to port 4000) and enter the 'clear foo string' command.
+ * then type whatever and observe that the vty interface is unresponsive
+ * for quite a period of time, due to the clear_something command
+ * taking a very long time to complete.
+ */
+#include <zebra.h>
+
+#include <lib/version.h>
+#include "getopt.h"
+#include "thread.h"
+#include "vty.h"
+#include "command.h"
+#include "memory.h"
+
+struct thread_master *master;
+
+struct option longopts[] = 
+{
+  { "daemon",      no_argument,       NULL, 'd'},
+  { "config_file", required_argument, NULL, 'f'},
+  { "help",        no_argument,       NULL, 'h'},
+  { "vty_addr",    required_argument, NULL, 'A'},
+  { "vty_port",    required_argument, NULL, 'P'},
+  { "version",     no_argument,       NULL, 'v'},
+  { 0 }
+};
+
+enum
+{
+  ITERS_FIRST = 0,
+  ITERS_PRINT = 10,
+  ITERS_MAX = 1000,
+};
+
+static void
+slow_func (struct vty *vty, char *str, int i)
+{
+  usleep (10000);
+  if ((i % ITERS_PRINT) == 0)
+    printf ("%s did %d%s", str, i, VTY_NEWLINE);  
+}
+
+static void
+clear_something (struct vty *vty, char *str)
+{
+  int i;
+  
+  /* this could be like iterating through 150k of route_table 
+   * or worse, iterating through a list of peers, each with 150k routes...
+   */
+  for (i = ITERS_FIRST; i < ITERS_MAX; i++)
+    slow_func (vty, str, i);
+    
+  XFREE (MTYPE_TMP, str);
+}
+
+DEFUN (clear_foo,
+       clear_foo_cmd,
+       "clear foo .LINE",
+       "clear command\n"
+       "arbitrary string\n")
+{
+  char *str;
+  if (!argc)
+    {
+      vty_out (vty, "%% string argument required%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+  
+  str = argv_concat (argv, argc, 0);
+  
+  clear_something (vty, str);
+  return CMD_SUCCESS;
+}
+
+static void
+slow_vty_init()
+{
+  install_element (VIEW_NODE, &clear_foo_cmd); 
+}
+
+/* Help information display. */
+static void
+usage (char *progname, int status)
+{
+  if (status != 0)
+    fprintf (stderr, "Try `%s --help' for more information.\n", progname);
+  else
+    {    
+      printf ("Usage : %s [OPTION...]\n\
+Daemon which does 'slow' things.\n\n\
+-d, --daemon       Runs in daemon mode\n\
+-f, --config_file  Set configuration file name\n\
+-A, --vty_addr     Set vty's bind address\n\
+-P, --vty_port     Set vty's port number\n\
+-v, --version      Print program version\n\
+-h, --help         Display this help and exit\n\
+\n\
+Report bugs to %s\n", progname, ZEBRA_BUG_ADDRESS);
+    }
+  exit (status);
+}
+
+
+/* main routine. */
+int
+main (int argc, char **argv)
+{
+  char *p;
+  char *vty_addr = NULL;
+  int vty_port = 4000;
+  int daemon_mode = 0;
+  char *progname;
+  struct thread thread;
+  char *config_file = NULL;
+  
+  /* Set umask before anything for security */
+  umask (0027);
+
+  /* get program name */
+  progname = ((p = strrchr (argv[0], '/')) ? ++p : argv[0]);
+
+  /* master init. */
+  master = thread_master_create ();
+
+  while (1) 
+    {
+      int opt;
+
+      opt = getopt_long (argc, argv, "dhf:A:P:v", longopts, 0);
+    
+      if (opt == EOF)
+	break;
+
+      switch (opt) 
+	{
+	case 0:
+	  break;
+        case 'f':
+          config_file = optarg;
+          break;
+	case 'd':
+	  daemon_mode = 1;
+	  break;
+	case 'A':
+	  vty_addr = optarg;
+	  break;
+	case 'P':
+          /* Deal with atoi() returning 0 on failure */
+          if (strcmp(optarg, "0") == 0)
+            {
+              vty_port = 0;
+              break;
+            } 
+          vty_port = atoi (optarg);
+          vty_port = (vty_port ? vty_port : 4000);
+  	  break;
+	case 'v':
+	  print_version (progname);
+	  exit (0);
+	  break;
+	case 'h':
+	  usage (progname, 0);
+	  break;
+	default:
+	  usage (progname, 1);
+	  break;
+	}
+    }
+
+  /* Library inits. */
+  cmd_init (1);
+  vty_init (master);
+  memory_init ();
+
+  /* OSPF vty inits. */
+  slow_vty_init ();
+
+  sort_node ();
+
+  /* Change to the daemon program. */
+  if (daemon_mode)
+    daemon (0, 0);
+
+  /* Create VTY socket */
+  vty_serv_sock (vty_addr, vty_port, "/tmp/.heavy.sock");
+  
+  /* Configuration file read*/
+  if (!config_file)
+    usage (progname, 1);
+  vty_read_config (config_file, NULL);
+  
+  /* Fetch next active thread. */
+  while (thread_fetch (master, &thread))
+    thread_call (&thread);
+
+  /* Not reached. */
+  exit (0);
+}
+
