46. Threads

This chapter covers the use of Tcl’s thread API from C and the use of Tcl in threaded programs. Complex programming with threads is tricky and can lead to difficult-to-find errors if not treated with caution. We discuss Tcl’s API but do not cover the nuances of programming with threads. For a thorough discussion of the topic, refer to books such as Programming with POSIX Threads by David Butenhof (ISBN 0-201-63392-2).

46.1 Functions Presented in This Chapter

This chapter discusses the following functions related to thread management in Tcl:

int Tcl_CreateThread(Tcl_ThreadId *idPtr,              Tcl_ThreadCreateProc threadProc,              ClientData clientData, int stackSize, int flags)

Creates a new thread whose new ID is stored ...

Get Tcl and the Tk Toolkit, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.