TclHttpd: Working example of multi-threaded operation?


does anyone use the multi-threaded feature of the TclHttpd server
and got the server running?

How do I install an URL handler to be run as a worker
thread correctly? Have I understood it correctly that
the URL handler must respond with Thread_Respond like in
the following example?

Url_PrefixInstall $prefix [list InternalThreadedDomainHandler $prefix] -thread 1

proc getTimedPage {} {
  set html    "<html><title>Timed Page</title><body>\n"
  append html "Time: [clock format [clock seconds]]"
  append html "</body>\n"
  return $html

proc InternalThreadedDomainHandler {prefix sock suffix} {
  upvar #0 Httpd$sock data
  set html [getTimedPage]
  Thread_Respond $sock [list Httpd_ReturnData $sock text/html $html]

Working code highly appreciated!