Tcl Source Code

View Ticket
Login
Ticket UUID: 3534440
Title: tpool::wait does not return pending jobs
Type: Bug Version: obsolete: 8.5.11
Submitter: tomkiti Created on: 2012-06-11 21:05:56
Subsystem: 80. Thread Package Assigned To: vasiljevic
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2012-09-13 18:29:07
Resolution: Accepted Closed By: vasiljevic
    Closed on: 2012-09-13 11:29:07
Description:
If the optional ?varname? is supplied to tpool::wait, it returns an empty string even if there are jobs pending.
User Comments: vasiljevic added on 2012-09-13 18:29:07:

allow_comments - 1

Fixed in 2.7

tomkiti added on 2012-06-15 11:02:30:
Thank you for fixing it!

vasiljevic added on 2012-06-14 16:13:31:
Hi!

It was not (as anticipated) a race-condition. It was a regular bug.
I now need to figure out how to submit my changes using this all
new fancy SCM system that I', new at...

The fix will appear in 2.7.0 release. Thank you for reporting the bug.

vasiljevic added on 2012-06-14 00:15:50:
OK. I am now able to reproduce it. This is a kind-of race condition
which I have to understand. This is the explanation why it is sometimes
visible and why not.

vasiljevic added on 2012-06-13 03:13:48:
Are you compiling the extension yourself or do you use
precompiled binary?

vasiljevic added on 2012-06-13 03:00:03:
Unfortunately... I cannot reproduce this at will.
I DO get sometimes the same result but only
when I use some older compilation of the extension.
If I recompile the, say, 2.6.5 fresh, I cannot get any problem.
I will look into this in more detail but this will require time.

vasiljevic added on 2012-06-13 02:19:50:
Then we will need to debug that part :-)

tomkiti added on 2012-06-13 01:10:21:
I just tried it with ActiveTcl8.4.19 and see the problem.

vasiljevic added on 2012-06-13 00:02:09:
So far I can see, the code from 2.6.5 and 2.6.7 did not change.
Which means that it has something to do with core 8.5.11.
We are still at 8.4 and there I cannot see any problem.

vasiljevic added on 2012-06-12 23:49:23:
Wierd. Then somebody broke something between 2.6.6
(the last one I made any changes to) and the 2.6.7...
This needs more examination.

tomkiti added on 2012-06-12 23:32:32:
I get a different result:

Z:\>tclsh
% package require Thread
2.6.7
% tpool::create
tpool01413310
% tpool::post tpool01413310 "after 100000"
1
% tpool::post tpool01413310 "after 50000"
2
% tpool::wait tpool01413310 "1 2" pending
2
% set pending
% exit

Z:\>

I'm running ActiveTcl8.5.11 on Windows 7, RedHat 5.7, and SunOS 5.9 and get the same results.

vasiljevic added on 2012-06-12 22:02:49:
I cannot verify this. For me it seems to work correctly:

lexxsrv:nscp 1> tpool::create 
tpool0x3a7d270
lexxsrv:nscp 2> tpool::post tpool0x3a7d270 "after 100000"
1
lexxsrv:nscp 3>  tpool::post tpool0x3a7d270 "after 50000"
2
lexxsrv:nscp 4> tpool::wait tpool0x3a7d270 "1 2" pending
2
lexxsrv:nscp 5> set pending
1

tomkiti added on 2012-06-12 04:05:56:

File Added - 445803: tpoolBug.tcl

Attachments: