Artifacts Associated With Ticket 219407
Ticket change [00cd78e147] (rid 119374) by nobody on 2000-10-26 05:12:32:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- 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 . - foundin initialized to: "obsolete: 8.3.2"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "69. Other"
- title initialized to:
Tcl_Finalize does not stop Tcl_Main (started in a thread)
- type initialized to: "Bug"
Ticket change [0c766746f4] (rid 114179) by dkf on 2001-01-27 22:26:52:
- icomment:
I suspect that this bug report might stem from a misunderstanding of the purpose of Tcl_Finalize...
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [89fbe8384e] (rid 127313) by dkf on 2001-01-31 17:43:11:
- subsystem changed to: "02. Event Loops"
Ticket change [39e081032d] (rid 112467) by davygrvy on 2001-09-09 07:07:11:
- 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.
- login: "davygrvy"
- mimetype: "text/plain"
- username: "davygrvy"
- icomment:
Ticket change [e1aa5a8061] (rid 87494) by davygrvy on 2001-09-09 08:32:27:
- 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.
- login: "davygrvy"
- mimetype: "text/plain"
- username: "davygrvy"
- icomment:
Ticket change [1e1444475c] (rid 90915) by dkf on 2002-04-27 05:43:32:
- assignee changed to: "davygrvy"
Ticket change [cb651f3394] (rid 95507) by davygrvy on 2002-05-28 08:16:33:
- closedate changed to: "2002-05-28T01:16:33"
- closer changed to: "davygrvy"
- 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().
- login: "davygrvy"
- mimetype: "text/plain"
- resolution changed to: "Rejected"
- status changed to: "Closed"
- username: "davygrvy"
Ticket change [734724ac45] (rid 105020) by dgp on 2002-05-30 05:57:05:
- closedate changed to: "2002-05-29T22:57:05"
- closer changed to: "dgp"
- 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.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
Ticket change [bec12c4a14] (rid 102130) by davygrvy on 2002-05-31 04:58:04:
- closedate changed to: "2002-05-30T21:58:04"
- closer changed to: "davygrvy"
- 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.
- login: "davygrvy"
- mimetype: "text/plain"
- username: "davygrvy"