Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2004-11-27
13:14 • Closed ticket [933975ffff]: tpool::create -minworkers plus 7 other changes artifact: 9f112da868 user: vasiljevic
01:28 • Ticket [933975ffff]: 4 changes artifact: fe6ad71c26 user: vasiljevic
2004-04-13
21:06 • Ticket [933975ffff]: 4 changes artifact: df4cc81078 user: vasiljevic
20:52 • Ticket [933975ffff]: 4 changes artifact: 04ef0d5e2f user: mooooooo
14:53 • Ticket [933975ffff]: 4 changes artifact: f6d65a36a7 user: vasiljevic
03:33 • New ticket [933975ffff]. artifact: 4adf5ba522 user: mooooooo

tpool::create -minworkers

Closed / Fixed933975ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 22 years ago
Descriptionplain2004-04-13 03:33:51
When using larger values for -minworkers tpool::create
never returns and Ctrl-C is required.  On my platform,
it seems to not like more than 12 worker threads. 
Setting -maxworkers fixes it with some larger values
but not others.

Minimal sample code:

  package require Thread 2.6
  set ::threads [tpool::create -minworkers 16 -idletime
120]
  puts "id $::threads"

Both Tcl and Threads 2.6 were pulled from CVS
lastnight, but I noticed the same problem with 2.5. 
tpool.tcl works as expected.

Fully updated Redhat/Fedora Core 1, dual Athlon 2100, 1
gig of system memory.
vasiljevicplain2004-04-13 14:53:46
Logged In: YES 
user_id=95086

Can you please fire up the tclsh under gdb debugger 
and see what it says? 
I think that the process cores. The fact that you 
have to do ctrl-c means probably that some of the 
clone'd Linux processes (aka threads) have gone. 
 
On my machine I can easily create 3-4 pools with  
16 workers each. 
 
Zoran
moooooooplain2004-04-13 20:52:39
Logged In: YES 
user_id=588167

Attached is gdb output.  It doesn't seem to core.

[root@security root]# gdb /opt/tcl/bin/tclsh8.5
GNU gdb Red Hat Linux (5.3.90-0.20030710.41rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public
License, and you are
welcome to change it and/or distribute copies of it under
certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show
warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
(no debugging symbols found)...Using host libthread_db
library "/lib/tls/libthre
ad_db.so.1".

(gdb) run t.tcl
Starting program: /opt/tcl/bin/tclsh8.5 t.tcl
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...[Thread debugging using
libthread_db enabled]
[New Thread -1084627424 (LWP 17766)]
(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols
found)...[New Thread -10846
30096 (LWP 17773)]

(no debugging symbols found)...[New Thread -1097217104 (LWP
17774)]
[New Thread -1107706960 (LWP 17775)]

###
###  Did Ctrl-C here.
###

Program received signal SIGINT, Interrupt.
[Switching to Thread -1084627424 (LWP 17766)]
0x0086ec32 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
(gdb) bt
#0  0x0086ec32 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x00af4424 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/tls/libpthread.so.0
#2  0x005d91ea in Tcl_ConditionWait () from
/opt/tcl/lib/libtcl8.5.so
#3  0x00dc3565 in CreateWorker () from
/opt/tcl/lib/thread2.6/libthread2.6.so
#4  0x00dc2557 in TpoolCreateObjCmd ()
   from /opt/tcl/lib/thread2.6/libthread2.6.so
#5  0x005695ad in TclEvalObjvInternal () from
/opt/tcl/lib/libtcl8.5.so
#6  0x00569ce4 in Tcl_EvalEx () from /opt/tcl/lib/libtcl8.5.so
#7  0x005b8fdb in TclSubstTokens () from
/opt/tcl/lib/libtcl8.5.so
#8  0x00569f69 in Tcl_EvalEx () from /opt/tcl/lib/libtcl8.5.so
#9  0x005a9865 in Tcl_FSEvalFileEx () from
/opt/tcl/lib/libtcl8.5.so
#10 0x005af23d in Tcl_Main () from /opt/tcl/lib/libtcl8.5.so
#11 0x0804875e in main ()
(gdb)
vasiljevicplain2004-04-13 21:06:47
Logged In: YES 
user_id=95086

Thanks. I will look into this.  
Somehow, the thread which is supposed to be started, 
never will. I just hang-on waiting for it.  
This might be an issue of the Tcl core and the state 
of the notifier thread which is responsible for doing 
inter-thread signalling.  
 
I did not try the 8.5 yet. It may be also an OS-issue. 
Let me see if I can add some debug printouts at some 
neuralgic places to be able to follow what is going on. 
Again, on my Linux (suse 9.0) and a moderate PC, I never 
experienced any problems in that area.
vasiljevicplain2004-11-27 01:28:16
Logged In: YES 
user_id=95086

I have been able to verify this with 8.5.  
Well, something is really wrong with the Tcl notifier. 
I don't know which limit we're hitting here but I will 
find this out...
vasiljevicplain2004-11-27 13:14:18
Logged In: YES 
user_id=95086

Allright. Fixed in CVS head. 
It was nothing with the Tcl notifier. It was my fault. 
I simply messed things up during pool creation  
which resulted in a subtle race condition.
Log in (anonymous is fine) to add a comment.