Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2011-10-26
23:24 • Closed ticket [3427545fff]: Tcl_CreateInterp() hangs plus 6 other changes artifact: c62ef4562d user: realmojo
23:24 • Ticket [3427545fff]: 4 changes artifact: 5af47d3ec9 user: realmojo
00:34 • Ticket [3427545fff]: 4 changes artifact: 80ce584634 user: dgp
00:27 • Ticket [3427545fff]: 4 changes artifact: 92cecdccd6 user: dgp
2011-10-25
06:03 • Ticket [3427545fff]: 1 change artifact: 8ec7415268 user: realmojo
2011-10-23
21:11 • Ticket [3427545fff]: 2 changes artifact: 37b77facfb user: realmojo
14:09 • New ticket [3427545fff]. artifact: 9420339796 user: realmojo

Tcl_CreateInterp() hangs

Closed3427545fffffffffffffffffffffffffffffffffCreated 15 years agoUpdated 15 years ago
Descriptionplain2011-10-23 14:09:30
Dear all, 

   I try to integrate tcl interpreter into my C++ program, but when I 
call Tcl_CreateInterp() 3rd times in a new thread, it hangs.  This 
problem only occurs in tcl85.dll.  when I change to tcl83.dll, this 
problem disappeared.  Here is my code.  Thank you for help 


#include <afxwin.h> 
#include "tcl.h" 
#include <iostream> 
#include <process.h> 


using namespace std; 


DWORD WINAPI TclThread(LPVOID) 
{ 
    Tcl_Interp *interp = Tcl_CreateInterp(); 
    cout << " exit TclThread " << endl; 
        return 0; 
} 

int main(int argc, char *argv[]) 
{ 
  for (int i = 0; i < 3; i++) 
  { 
      unsigned long p; 
      CreateThread(NULL, 0, TclThread, NULL, 0, &p); 
      Sleep(2000); 
  } 

  system("pause"); 
}
realmojo Ticket [3427545fff]: 2 changes [History diff]2011-10-23 21:11:00
realmojo Ticket [3427545fff]: 1 change [History diff]2011-10-25 06:03:17
dgpplain2011-10-26 00:27:44
Don't know why my comment yesterday didn't appear..
dgpplain2011-10-26 00:34:00
Confirm that your Tcl library was built
with --enable-threads.

Use [tcl::pkgconfig get threaded] to test.
realmojoplain2011-10-26 23:24:19
Thanks dgp. It works now
realmojoplain2011-10-26 23:24:32
allow_comments - 1
Log in (anonymous is fine) to add a comment.