Menu

Using Tcl C functions to synchronize threads (Tcl_MutexLock, Tcl_ConditionWait, etc)

Anonymous
2021-08-20
2021-11-08
  • Anonymous

    Anonymous - 2021-08-20

    First off, I'd like to thank Ashok for the fantastic work you did of porting Tcl to Windows. I work mostly on Unix/Linux and it's a real relief of being able to use the tools I know on Windows.

    I can create threads in Tcl scripts with the Thread package and also use the syncrhonization functionalities provided by the package (thread::mutex, thread::cond, etc). But using the equivalent C functions provided by the Tcl library doesn't work. The man page of Tcl_MutexLock and company says that the functions are defined as empty macros when Tcl is not built with thread support and this what I see when debugging a test program I wrote to use those functions; the debugger just ignores any of those functions. I tried to define TCL_THREADS in the preprocessor but then the test program crashes.

    Would anyone have an idea what I'm missing?

     
  • Ashok P. Nadkarni

    First, sorry about the late response. Like many other posts this was sitting in the unmoderated forum section.

    Second, just for the record, I did not port Tcl to Windows! Windows support was already there from the early days. I am only responsible for the twapi extension and the magicsplat distribution.

    Regarding your question, how did you build Tcl and on what platform. You need to build Tcl with --enable-threads if you are using the autoconf build system? Difficult to answer your question without additional details.

    As an aside, general questions such as this are best asked in comp.lang.tcl on Usenet as you will find a wider variety of experts there.

    /Ashok

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.