Skip to content
Tcl Source Code Artifact [fb487cd4c1]
Login

Artifact [fb487cd4c1]

Artifact fb487cd4c1d2a697d2d56efc1e5242b80308fe56:

Wiki page [Event Loops] by dgp on 2014-10-09 17:15:54.
D 2014-10-09T17:15:54.486
L Event\sLoops
P 012e1ebac103713a3ade079d8a81fb363dd235f5
U dgp
W 2180
Lets break this down:

  *  [Event Loop Commands]
  *  [Background Exceptions]
  *  [(Initi/Fin)alize]

<h1>Source Files</h1>
  *  [/finfo?name=generic/tclEvent.c|tclEvent.c]

<h1>Public Interface</h1>
  *  Tcl_BackgroundError
  *  Tcl_BackgroundException
  *  Tcl_CreateExitHandler
  *  Tcl_DeleteExitHandler
  *  Tcl_CreateThreadExitHandler
  *  Tcl_DeleteThreadExitHandler
  *  Tcl_SetExitProc
  *  Tcl_Exit
  *  Tcl_Finalize
  *  Tcl_FinalizeThread

<h1>Private Interface</h1>
  *  TclDefaultBgErrorHandlerObjCmd
  *  TclSetBgErrorHandler
  *  TclGetBgErrorHandler
  *  TclCreateLateExitHandler
  *  TclDeleteLateExitHandler
  *  TclInitSubsystems
  *  TclInExit
  *  TclInThreadExit
  *  Tcl_VwaitObjCmd
  *  Tcl_UpdateObjCmd

<h1>Directly Depends On Public Interface</h1>
  *  <i>just about everything</i>

<h1>Directly Depends On Private Interface of</h1>
  *  <i>just about everything</i>

<h1>Discussion</h1>

This module gets its name because the [update] and [vwait] commands
are defined here.  Those commands are built entirely on the public
routines of the Tcl C interface, though.  They could be defined exactly
as they are even in an extension.

Another related set of functionality are the routines for raising background
exceptions, and those for registering callback commands in each interp
to handle them.  Except for the connection to [interp bgerror] and an edge
case of hidden command invocation, these routines can be created entirely
outside the Tcl public interface as well.  Moving this submodule into
[interp] should be considered.

Finally the rest of this module is devoted to control over the initialization
and finalization of the subsystems of Tcl, and extensions to it by way of
exit handlers and thread exit handlers.  This is the part that could use a
good audit and reform, particularly in examining  multi-threaded
finalization.  The routine <b>TclInitSubsystems</b> needs to become
public, so that Tcl using apps can bring up and tear down the Tcl library
via an approved set of routines.  It may be that the <b>TclIn(Thread)Exit</b>
routines are needed by extensions as well.



Z 86056a956ec86d2d0f9d517b697b9799