PtTcl: using Tcl with Pthreads

  • Authors:
  • D. Richard Hipp;Mike Cruse

  • Affiliations:
  • Hwaci, Maple Cove Lane, Charlotte, NC;CTI, Ltd., Prescott, AZ

  • Venue:
  • TCLTK'97 Proceedings of the 5th conference on Annual Tcl/Tk Workshop 1997 - Volume 5
  • Year:
  • 1997

Quantified Score

Hi-index 0.00

Visualization

Abstract

Tcl is not thread-safe. If two or more threads attempt to use Tcl at the same time, internal data structures can be corrupted and the program can crash. This is true even if the threads are using separate Tcl interpreters. PtTcl is a modification to the Tcl core that makes Tcl safe to use with POSIX threads. With PtTcl, each thread can create and use its own Tcl interpreters that will not interfere with interpreters used in other threads. A message-passing mechanism allows Tcl interpreters running in different treads to communicate. However, even with PtTcl, the same interpreter still cannot be accessed by more than one thread. This paper describes the design, implementation and use of PtTcl.