Skip to content
Tcl Source Code Artifact [1c8c6d24ee]
Login

Artifact [1c8c6d24ee]

Artifact 1c8c6d24eea53d78fe8786b2f917a4e3b7928fe9:

Wiki page [Threads] by dgp on 2014-08-29 23:12:06.
D 2014-08-29T23:12:06.121
L Threads
P 0bef42a5669e72abb586413f20d1be3af5ea9763
U dgp
W 2948
<h1>Source Files</h1>
  *  [/finfo?name=generic/tclThread.c|tclThread.c]
  *  [/finfo?name=generic/tclThreadJoin.c|tclThreadJoin.c]
  *  [/finfo?name=generic/tclThreadStorage.c|tclThreadStorage.c]
  *  [/finfo?name=unix/tclUnixThrd.c|tclUnixThrd.c]
  *  [/finfo?name=win/tclWinThrd.c|tclWinThrd.c]

<h1>Public Interface</h1>
  *  Tcl_ConditionNotify
  *  Tcl_ConditionWait
  *  Tcl_ConditionFinalize
  *  Tcl_GetThreadData
  *  Tcl_MutexLock
  *  Tcl_MutexUnlock
  *  Tcl_MutexFinalize
  *  Tcl_JoinThread
  *  <i>Tcl_CreateThread</i>
  *  <i>Tcl_ExitThread</i>
  *  <i>Tcl_GetCurrentThread</i>
  *  <i>Tcl_GetAllocMutex</i>

<h1>Private Interface</h1>
  *  TclThreadDataKeyGet
  *  TclFinalizeThreadData
  *  TclFinalizeSynchronization
  *  TclInitThreadStorage
  *  TclpThreadCreate
  *  TclpThreadExit
  *  TclpInitLock
  *  TclFinalizeLock
  *  TclpInitUnlock
  *  TclpNewAllocMutex
  *  TclpFreeAllocMutex
  *  TclpFreeAllocCache
  *  TclpGetAllocCache
  *  TclpSetAllocCache
  *  <i>TclpReaddir</i>
  *  <i>TclpInetNtoa</i>

<h1>Internal Interface</h1>
  *  TclRememberMutex
  *  TclRememberCondition
  *  TclJoinThread
  *  TclRememberJoinableThread
  *  TclSignalExitThread
  *  TclThreadStorageKeyGet
  *  TclThreadStorageKeySet
  *  TclFinalizeThreadDataThread
  *  TclFinalizeThreadStorage
  *  TclpMasterLock
  *  TclpMasterUnlock
  *  TclpFinalizeMutex
  *  TclpFinalizeCondition
  *  TclpThreadCreateKey
  *  TclpThreadDeleteKey
  *  TclpThreadSetMasterTSD
  *  TclpThreadGetMasterTSD
 
<h1>Directly Depends On Public Interface</h1>
  *  [Allocation]
  *  [Event Loops]
  *  <i>string.h</i>

<h1>Directly Depends On Private Interface of</h1>
  *  [Allocation]

<h1>Discussion</h1>

The boundaries of this module are a bit murky.  The routine <b>Tcl_GetCurrentThread</b>
is defined here, but documented as part of the [Notifier].  The routine <b>Tcl_ExitThread</b> is defined here, but documented alongside <b>Tcl_Exit</b> as part of [Event Loops].  The routine
<b>Tcl_GetAllocMutex</b> ought not be public at all (see [547989]).  The routine
<b>Tcl_CreateThread</b> pretty clearly ought to be here and is documented with the rest
of the [Threads] routines, but is actually found over in [/finfo?name=generic/tclEvent.c|tclEvent.c]
as part of [Event Loops].  Perhaps these can be tidied up.

The routines <b>TclpReaddir</b>and <b>TclpInetNtoa</b> only exist at all for the sake of
stubs compatibility with extensions originally built against rather old (arguably buggy) 
tclUnixPort.h files.  They definitely ought not survive into Tcl 9.

The dependence on [Event Loops] is apparently a correctible error in module boundary
drawing.  Then the dependency cycle between [Threads] and [Allocation] is a target to
refactor away, so that a clean dependency DAG might emerge, and so that tidy sequences
of initialization and finalization might be determined.
Z fcaece4f667e50a5c646d666b1bd58a1