Artifacts Associated With Ticket 1512225fffffffff
Ticket change [b8dcf95d89] (rid 129035) by nyademo on 2006-06-25 18:38:22:
- assignee initialized to: "vasiljevic"
- cmimetype initialized to: "text/plain"
- comment initialized to:
tpool::wait and tpool::cancel set wrong value to optional variable. Windows2000 ActiveTcl8.4.13 Thread2.6.3 compiled by VC6 Sample code for tpool::wait ------------------------------------------------------- set tp [tpool::create -maxworkers 1] for {set i 1} {$i < 10} {incr i} { puts [tpool::post -nowait $tp [subst { puts $i:start after 5000 puts $i:end }]] } puts [tpool::wait $tp {4 5 6} waiting]:DONE if {[llength $waiting] != 2} { error "waiting is $waiting" } In this code, only one worker thread is worked. So posted jobs are eval one by one. When the 4 job is finishing, tpool::wait returns from event loop, and returns number 4, and should set a list of waiting jobs (5 and 6) to "waiting" variable. But "waiting" variable is empty list. Sample code for tpool::wait ------------------------------------------------------- set tp [tpool::create -maxworkers 1] for {set i 1} {$i < 10} {incr i} { puts [tpool::post -nowait $tp [subst { puts $i:start after 1000 puts $i:end }]] } after 5000 # jobs 1,2,3 was already done here tpool::cancel $tp {1 2 3} uncanceled if {$uncanceled ne {1 2 3}} { # may be $uncanceled is {1 1 1 2 2 2 3 3 3} error "uncanceled is $uncanceled" } In this code, only one worker thread is worked. So posted jobs are eval one by one. After The 1, 2 and 3 jobs are finished, tpool::cancel is called. So 1,2,3 jobs can't be canceled. tpool::cancel returns empty list and should set a list of uncanceled jobs (1,2 and 3) to "uncanceled" variable. But "uncanceled" variable is {1 1 1 2 2 2 3 3 3} in this case. There isn't a test, so I have no confidence in detail of specifications... But I try to make a pach. see also that. thanks. - foundin initialized to: "obsolete: 8.4.13"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nyademo"
- subsystem initialized to: "80. Thread Package"
- title initialized to:
tpool::wait and tpool::cancel set wrong value to variable
- type initialized to: "Bug"
Add attachment "threadPoolCmd.c.patch" [7b379af435] (rid 90484) by nyademo on 2006-06-26 01:38:22.
Ticket change [da0f89114b] (rid 107709) by nyademo on 2006-06-26 01:38:22:
- icomment:
File Added - 182941: threadPoolCmd.c.patch
- login: "nyademo"
- mimetype: "text/plain"
- username: "nyademo"
- icomment:
Ticket change [994f190f33] (rid 110770) by vasiljevic on 2007-06-30 22:29:52:
- icomment:
Logged In: YES user_id=95086 Originator: NO Great work! Many thanks for the patch and your time. I have added this into the CVS head. Please checkout and see if all is fine. Your test programs work as expected now. The fixed will appear first in 2.6.6 version. Cheers, Zoran
- login: "vasiljevic"
- mimetype: "text/plain"
- username: "vasiljevic"
- icomment:
Ticket change [a5216b6798] (rid 110321) by vasiljevic on 2007-06-30 22:31:16:
- closedate changed to: "2007-06-30T15:31:16"
- closer changed to: "vasiljevic"
- resolution changed to: "Fixed"
- status changed to: "Closed"