Skip to content
Tcl Source Code History Of Ticket 219407
Login

History Of Ticket 219407

Artifacts Associated With Ticket 219407

  1. Ticket change [00cd78e147] (rid 119374) by nobody on 2000-10-26 05:12:32:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 6324 Bug
      Version: 8.3.2
      SubmitDate: '2000-09-28'
      LastModified: '2000-10-25'
      Severity: CRIT
      Status: UnAssn
      Submitter: techsupp
      OS: Linux-Red Hat
      FixedDate: '2000-10-25'
      ClosedDate: '2000-10-25'
      
      
      Name:
      Sree Oggu
      
      Extensions:
      tcl 8.3.2
      
      ReproducibleScript:
      // The folllowing c++ program does not exit
      
      #include "tcl.h"
      #include <pthread.h>
      #include <iostream.h>
      
      
      int
      Tcl_AppInit (Tcl_Interp *interp)
      {
          return Tcl_Init(interp);
      }
      
      void*
      Start (void* arg)
      {
          char* argv = "dummy";
          Tcl_Main (1, &argv, Tcl_AppInit);
          return 0;
      }
      
      
      main (int argc, char** argv)
      {
          pthread_t thr;
      
          pthread_create(&thr, 0, Start, 0);
      
          Tcl_Finalize();
      
          pthread_join (thr, 0);
      
          cout << "Terminating" << endl;
      }
      
      ObservedBehavior:
      Use the followng command to compile the above program
      
      g++ main.cc -ltcl -lpthread
      
      DesiredBehavior:
      I expect the program to terminate, since Tcl_Finalize has been invoked .
      
      
      
      
      
    4. foundin initialized to: "obsolete: 8.3.2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "69. Other"
    10. title initialized to:
      Tcl_Finalize does not  stop Tcl_Main (started in a thread)
      
    11. type initialized to: "Bug"
  2. Ticket change [0c766746f4] (rid 114179) by dkf on 2001-01-27 22:26:52:

    1. icomment:
      I suspect that this bug report might stem from a misunderstanding of the purpose of Tcl_Finalize...
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  3. Ticket change [89fbe8384e] (rid 127313) by dkf on 2001-01-31 17:43:11:

    1. subsystem changed to: "02. Event Loops"
  4. Ticket change [39e081032d] (rid 112467) by davygrvy on 2001-09-09 07:07:11:

    1. icomment:
      Logged In: YES 
      user_id=7549
      
      That's rather scary looking.  Tcl_Main wasn't meant to be a 
      child.  This can't be correct usage of Tcl_Main?
      
      And why should it stop it?  Why is Tcl_Finalize() supposed 
      to forcefully terminate child threads?
      
      Just my 2 cents...  I'm not sure of the "correct" answer.
      
      
    2. login: "davygrvy"
    3. mimetype: "text/plain"
    4. username: "davygrvy"
  5. Ticket change [e1aa5a8061] (rid 87494) by davygrvy on 2001-09-09 08:32:27:

    1. icomment:
      Logged In: YES 
      user_id=7549
      
      I didn't catch it before, but I see a typo now.  
      TCL_THREADS=1 is missing from the gcc commandline.  And I  
      think Tcl_CreateThread() should be used in place of 
      pthread_create(), but I might be cutting hairs on that 
      comment.
      
      I'd give it a shot, but I don't run *nix here.
      
      
    2. login: "davygrvy"
    3. mimetype: "text/plain"
    4. username: "davygrvy"
  6. Ticket change [1e1444475c] (rid 90915) by dkf on 2002-04-27 05:43:32:

    1. assignee changed to: "davygrvy"
  7. Ticket change [cb651f3394] (rid 95507) by davygrvy on 2002-05-28 08:16:33:

    1. closedate changed to: "2002-05-28T01:16:33"
    2. closer changed to: "davygrvy"
    3. icomment:
      Logged In: YES 
      user_id=7549
      
      Tcl_Finalize() is used for clean-up.  It's job doesn't include the 
      stopping of threads whether they are known by Tcl or not.  As 
      a user of threads, it would be your job to do your own clean-
      up.  I can not say that this new duty should be added to 
      Tcl_Finalize().
      
      
    4. login: "davygrvy"
    5. mimetype: "text/plain"
    6. resolution changed to: "Rejected"
    7. status changed to: "Closed"
    8. username: "davygrvy"
  8. Ticket change [734724ac45] (rid 105020) by dgp on 2002-05-30 05:57:05:

    1. closedate changed to: "2002-05-29T22:57:05"
    2. closer changed to: "dgp"
    3. icomment:
      Logged In: YES 
      user_id=80530
      
      Just to add a clarification, Tcl_Main() is only
      a convenience routine for people who are creating
      their own single-threaded shell programs.  It is
      not suitable for multi-threaded use, as it uses
      global variables.
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. username: "dgp"
  9. Ticket change [bec12c4a14] (rid 102130) by davygrvy on 2002-05-31 04:58:04:

    1. closedate changed to: "2002-05-30T21:58:04"
    2. closer changed to: "davygrvy"
    3. icomment:
      Logged In: YES 
      user_id=7549
      
      If threads are in use by, for example, the thread extension, 
      then the exit handler for it *should* send [thread::unwind]s to 
      all threads in use...
      
      At least the concept makes sense.  I should talk to Zoran 
      about this to see if it does.  A controlled tear-down is a 
      complicated thing with threads involed.  Is that thread blocked 
      on a system call?  How do we interupt it?  Should we care?  
      The announcement to exit is from another thread than the one 
      we want to close, so how can we inject shutdown notices to 
      them if they are blocked and not in the event loop?  Yuck.
      
      
    4. login: "davygrvy"
    5. mimetype: "text/plain"
    6. username: "davygrvy"